Ticket #13206: django-model_init_super_r12847.patch
File django-model_init_super_r12847.patch, 1.3 KB (added by , 15 years ago) |
---|
-
django/db/models/base.py
338 338 pass 339 339 if kwargs: 340 340 raise TypeError("'%s' is an invalid keyword argument for this function" % kwargs.keys()[0]) 341 super(Model, self).__init__() 341 342 signals.post_init.send(sender=self.__class__, instance=self) 342 343 343 344 def __repr__(self): -
tests/modeltests/model_inheritance/models.py
144 144 def __unicode__(self): 145 145 return self.content 146 146 147 class MultiMixin(object): 148 def __init__(self, *args, **kwargs): 149 self.other_variable = 1 150 151 class MixinModel(models.Model, MultiMixin): 152 pass 153 147 154 __test__ = {'API_TESTS':""" 148 155 # The Student and Worker models both have 'name' and 'age' fields on them and 149 156 # inherit the __unicode__() method, just as with normal Python subclassing. … … 376 383 3 377 384 >>> settings.DEBUG = False 378 385 386 >>> mm = MixinModel() 387 >>> getattr(mm, 'other_variable', False) 388 1 389 379 390 """}