Ticket #5817: model_meta_w_inheritance.diff
File model_meta_w_inheritance.diff, 963 bytes (added by , 17 years ago) |
---|
-
options.py
47 47 48 48 # Next, apply any overridden values from 'class Meta'. 49 49 if self.meta: 50 meta_attrs = self.meta.__dict__ 51 del meta_attrs['__module__'] 52 del meta_attrs['__doc__'] 50 # Build list of attributes - don't use __dict__, as we want to include 51 # super class attributes as well. 52 meta_attrs = dict([ 53 (name, getattr(self.meta, name)) 54 for name in dir(self.meta) 55 # exclude python built-in attributes 56 if not name.startswith('__')]) 53 57 for attr_name in DEFAULT_NAMES: 54 58 setattr(self, attr_name, meta_attrs.pop(attr_name, getattr(self, attr_name))) 55 59 # verbose_name_plural is a special case because it uses a 's'