7👍
✅
The problem is in
class Supplier(Person):
def __init__(self):
super(Supplier, self).__init__()
Have a look at django.db.models.Model source code
class Model(six.with_metaclass(ModelBase)):
_deferred = False
def __init__(self, *args, **kwargs):
Your __init__
function get only the instance itself as argument, but django is passing probably more arguments. That’s why you need to use *args, **kwargs
.
To better understand *args
and **kwargs
you can have a look at this
4👍
By fixing this error, update the Supplier model by adding the parameter *args, **kwargs
class Supplier(Person):
def __init__(self, *args, **kwargs):
super(Supplier, self).__init__(*args, **kwargs)
- [Django]-Django South vs Migratory
- [Django]-Django get current view in template
- [Django]-How to set a login cookie in django?
- [Django]-Sudo /etc/init.d/celeryd start generates a "Unknown command: 'celeryd_multi'"
- [Django]-Google OAUTH gives 502 error
Source:stackexchange.com