Ticket #419: django-core-meta-__init__.py.diff
File django-core-meta-__init__.py.diff, 1.5 KB (added by , 19 years ago) |
---|
-
django/core/meta/__init__.py
418 418 # attribute order. 419 419 fields.sort(lambda x, y: x.creation_counter - y.creation_counter) 420 420 421 # Should this class generate database tables (Default is Yes)? 422 # This has the ultimate effect of keeping this class out of the _MODELS 423 # list. 424 create_table = not (meta_attrs.pop('no_table', False)) 425 421 426 # If this model is a subclass of another model, create an Options 422 427 # object by first copying the base class's _meta and then updating it 423 428 # with the overrides from this class. … … 680 685 # contain this list: 681 686 # [<class 'django.models.polls.Poll'>, <class 'django.models.polls.Choice'>] 682 687 # Don't do this if replaces_module is set. 683 app_package.__dict__.setdefault('_MODELS', []).append(new_class) 688 # Exclude models where the user has set 'no_table = True' 689 if create_table: 690 app_package.__dict__.setdefault('_MODELS', []).append(new_class) 684 691 685 692 # Cache the app label. 686 693 opts.app_label = app_label … … 732 739 def __repr__(self): 733 740 return '<%s object>' % self.__class__.__name__ 734 741 742 735 743 ############################################ 736 744 # HELPER FUNCTIONS (CURRIED MODEL METHODS) # 737 745 ############################################