You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MyBaseModel(models.NodeModel):
name=StringProperty(indexed=True)
class Meta:
abstract = True
I inherit from MyBaseModel:
class User(MyBaseModel):
email=StringProperty()
And now:
u=User.objects.create(name='Fail')
TypeError: 'name' is an invalid keyword argument for this function
File "/home/tonjo/venv/tuned/local/lib/python2.7/site-packages/django/db/models/base.py", line 367, in __init__
raise TypeError("'%s' is an invalid keyword argument for this function" % kwargs.keys()[0])
TypeError: 'name' is an invalid keyword argument for this function
Not checking base classes?
The text was updated successfully, but these errors were encountered:
I don't know if it helps, but debugging django.db.models.base.Model.__init__,
which is called when calling .create on NodeModelManager, because of super,
we can see self._meta.fields does not contain any of the superclass field,
causing the error in line 415 of django/db/models/base.py.
In the above example it was probably Django 1.4, that's why it says line 367.
Consider the case:
I inherit from MyBaseModel:
And now:
Not checking base classes?
The text was updated successfully, but these errors were encountered: