import random from svarga models model import ModelBase factory sample

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import random
from svarga.models.model import *
ModelBase = factory('sampleapp')
class Test(ModelBase):
name = StringColumn()
value = IntegerColumn()
number = StringColumn(max_length=16)
class Ref(ModelBase):
name = UnicodeColumn()
test = ForeignKeyColumn(Test, backref='refs')
class Tag(ModelBase):
name = UnicodeColumn()
tests = ManyToManyColumn(Test, backref='tags')