I\'m trying to write an __init__
function for one of my models so that I can create an object by doing:
p = User(\'name\',\'email\')
The correct answer is to avoid overriding __init__
and write a classmethod as described in the Django docs.
But this could be done like you're trying, you just need to add in *args, **kwargs
to be accepted by your __init__
, and pass them on to the super method call.
def __init__(self, name, email, house_id, password, *args, **kwargs):
super(models.Model, self).__init__(self, *args, **kwargs)
self.name = name
self.email = email