Ticket #3163: meta-option-create_db_table.diff
File meta-option-create_db_table.diff, 2.2 KB (added by , 18 years ago) |
---|
-
django/core/management.py
474 474 print "Processing %s.%s model" % (app_name, model._meta.object_name) 475 475 if model._meta.db_table in table_list: 476 476 continue 477 if model._meta.create_db_table==False: 478 continue 477 479 sql, references = _get_sql_model_create(model, seen_models) 478 480 seen_models.add(model) 479 481 created_models.add(model) -
django/db/models/options.py
13 13 14 14 DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering', 15 15 'unique_together', 'permissions', 'get_latest_by', 16 'order_with_respect_to', 'app_label' )16 'order_with_respect_to', 'app_label', 'create_db_table') 17 17 18 18 class Options(object): 19 19 def __init__(self, meta): … … 33 33 self.has_auto_field = False 34 34 self.one_to_one_field = None 35 35 self.parents = [] 36 self.create_db_table = True 36 37 37 38 def contribute_to_class(self, cls, name): 38 39 cls._meta = self -
docs/model-api.txt
928 928 Here's a list of all possible ``Meta`` options. No options are required. Adding 929 929 ``class Meta`` to a model is completely optional. 930 930 931 ``create_db_table`` 932 ------------------- 933 934 If you don't want this model to be created as a table in your database (when 935 calling ``manage.py syncdb``), set this to ``False``. 936 937 create_db_table = False 938 939 If this isn't given, Django will assume ``True`` and ``manage.py syncdb`` will 940 create this model as a table in your database. 941 942 This is useful, when you are using DB views which you create via 943 raw SQL but still want to be able to use the view as a model from within your 944 application. 945 931 946 ``db_table`` 932 947 ------------ 933 948