-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
Description
I trying to repeat a demo tutorial with code:
from remodel.models import Model
from remodel.helpers import create_tables, create_indexes
class Products(Model):
has_many=('Code',)
has_one=('Value',)
class Code(Model):
has_one=('Value',)
class Value(Model):
belongs_to_many=('Product', 'Code',)
create_tables()
create_indexes()
code=Code.create(code='sample')
code['value'].add(Value.create(value=10))
And this code raises error:
Traceback (most recent call last):
File "models-test.py", line 18, in <module>
code['value'].add(Value.create(value=10))
AttributeError: 'NoneType' object has no attribute 'add'
Whats wrong with code?