Changeset 2329
- Timestamp:
- 02/17/06 13:42:11 (3 years ago)
- Files:
-
- django/branches/magic-removal/AUTHORS (modified) (1 diff)
- django/branches/magic-removal/django/contrib/admin/views/doc.py (modified) (1 diff)
- django/branches/magic-removal/django/contrib/admin/views/main.py (modified) (1 diff)
- django/branches/magic-removal/django/core/management.py (modified) (6 diffs)
- django/branches/magic-removal/django/db/backends/ado_mssql/creation.py (modified) (1 diff)
- django/branches/magic-removal/django/db/backends/mysql/creation.py (modified) (1 diff)
- django/branches/magic-removal/django/db/backends/postgresql/creation.py (modified) (1 diff)
- django/branches/magic-removal/django/db/backends/sqlite3/creation.py (modified) (1 diff)
- django/branches/magic-removal/django/__init__.py (modified) (1 diff)
- django/branches/magic-removal/docs/model-api.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/AUTHORS
r2301 r2329 89 89 plisk 90 90 Daniel Poelzleithner <http://poelzi.org/> 91 J. Rademaker 91 92 Brian Ray <http://brianray.chipy.org/> 92 93 Oliver Rutherfurd <http://rutherfurd.net/> django/branches/magic-removal/django/contrib/admin/views/doc.py
r2278 r2329 267 267 'PositiveIntegerField' : _('Integer'), 268 268 'PositiveSmallIntegerField' : _('Integer'), 269 'SlugField' : _('String (up to 50)'),269 'SlugField' : _('String (up to %(maxlength)s)'), 270 270 'SmallIntegerField' : _('Integer'), 271 271 'TextField' : _('Text'), django/branches/magic-removal/django/contrib/admin/views/main.py
r2220 r2329 404 404 p = '%s.%s' % (related.opts.app_label, related.opts.get_delete_permission()) 405 405 if not user.has_perm(p): 406 perms_needed.add(rel_opts .verbose_name)406 perms_needed.add(rel_opts_name) 407 407 for related in opts.get_all_related_many_to_many_objects(): 408 408 if related.opts in opts_seen: django/branches/magic-removal/django/core/management.py
r2313 r2329 64 64 # field as the field to which it points. 65 65 get_rel_data_type = lambda f: (f.get_internal_type() in ('AutoField', 'PositiveIntegerField', 'PositiveSmallIntegerField')) and 'IntegerField' or f.get_internal_type() 66 67 def get_version(): 68 "Returns the version as a human-format string." 69 from django import VERSION 70 v = '.'.join([str(i) for i in VERSION[:-1]]) 71 if VERSION[3]: 72 v += ' (%s)' % VERSION[3] 73 return v 66 74 67 75 def get_sql_create(app): … … 822 830 def get_validation_errors(outfile, app=None): 823 831 """ 824 Validates all models that are part of the specified app. If no app name is provided, 825 validates all models of all installed apps. Writes errors, if any, to outfile. 832 Validates all models that are part of the specified app. If no app name is provided, 833 validates all models of all installed apps. Writes errors, if any, to outfile. 826 834 Returns number of errors. 827 835 """ … … 871 879 if f.rel.to not in models.get_models(): 872 880 e.add(opts, "'%s' relates to uninstalled model %s" % (f.name, rel_opts.object_name)) 873 881 874 882 rel_name = RelatedObject(f.rel.to, cls, f).get_accessor_name() 875 883 for r in rel_opts.fields: … … 880 888 e.add(opts, "'%s' accessor name '%s.%s' clashes with a m2m field" % (f.name, rel_opts.object_name, r.name)) 881 889 for r in rel_opts.get_all_related_many_to_many_objects(): 882 if r.get_accessor_name() == rel_name: 890 if r.get_accessor_name() == rel_name: 883 891 e.add(opts, "'%s' accessor name '%s.%s' clashes with a related m2m field" % (f.name, rel_opts.object_name, r.get_accessor_name())) 884 892 for r in rel_opts.get_all_related_objects(): 885 893 if r.get_accessor_name() == rel_name and r.field is not f: 886 894 e.add(opts, "'%s' accessor name '%s.%s' clashes with a related field" % (f.name, rel_opts.object_name, r.get_accessor_name())) 887 895 888 896 for i, f in enumerate(opts.many_to_many): 889 897 # Check to see if the related m2m field will clash with any … … 901 909 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with a m2m field" % (f.name, rel_opts.object_name, r.name)) 902 910 for r in rel_opts.get_all_related_many_to_many_objects(): 903 if r.get_accessor_name() == rel_name and r.field is not f: 911 if r.get_accessor_name() == rel_name and r.field is not f: 904 912 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with a related m2m field" % (f.name, rel_opts.object_name, r.get_accessor_name())) 905 913 for r in rel_opts.get_all_related_objects(): … … 1120 1128 def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING): 1121 1129 # Parse the command-line arguments. optparse handles the dirty work. 1122 parser = DjangoOptionParser( get_usage(action_mapping))1130 parser = DjangoOptionParser(usage=get_usage(action_mapping), version=get_version()) 1123 1131 parser.add_option('--settings', 1124 1132 help='Python path to settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') django/branches/magic-removal/django/db/backends/ado_mssql/creation.py
r1637 r2329 18 18 'PositiveIntegerField': 'int CONSTRAINT [CK_int_pos_%(column)s] CHECK ([%(column)s] > 0)', 19 19 'PositiveSmallIntegerField': 'smallint CONSTRAINT [CK_smallint_pos_%(column)s] CHECK ([%(column)s] > 0)', 20 'SlugField': 'varchar( 50)',20 'SlugField': 'varchar(%(maxlength)s)', 21 21 'SmallIntegerField': 'smallint', 22 22 'TextField': 'text', django/branches/magic-removal/django/db/backends/mysql/creation.py
r1637 r2329 22 22 'PositiveIntegerField': 'integer UNSIGNED', 23 23 'PositiveSmallIntegerField': 'smallint UNSIGNED', 24 'SlugField': 'varchar( 50)',24 'SlugField': 'varchar(%(maxlength)s)', 25 25 'SmallIntegerField': 'smallint', 26 26 'TextField': 'longtext', django/branches/magic-removal/django/db/backends/postgresql/creation.py
r1637 r2329 22 22 'PositiveIntegerField': 'integer CHECK ("%(column)s" >= 0)', 23 23 'PositiveSmallIntegerField': 'smallint CHECK ("%(column)s" >= 0)', 24 'SlugField': 'varchar( 50)',24 'SlugField': 'varchar(%(maxlength)s)', 25 25 'SmallIntegerField': 'smallint', 26 26 'TextField': 'text', django/branches/magic-removal/django/db/backends/sqlite3/creation.py
r1637 r2329 21 21 'PositiveIntegerField': 'integer unsigned', 22 22 'PositiveSmallIntegerField': 'smallint unsigned', 23 'SlugField': 'varchar( 50)',23 'SlugField': 'varchar(%(maxlength)s)', 24 24 'SmallIntegerField': 'smallint', 25 25 'TextField': 'text', django/branches/magic-removal/django/__init__.py
r3 r2329 1 VERSION = (0, 9, 1, 'SVN') django/branches/magic-removal/docs/model-api.txt
r2116 r2329 411 411 used in URLs. 412 412 413 Implies ``maxlength=50`` and ``db_index=True``. 413 In the Django development version, you can specify ``maxlength``. If 414 ``maxlength`` is not specified, Django will use a default length of 50. In 415 previous Django versions, there's no way to override the length of 50. 416 417 Implies ``db_index=True``. 414 418 415 419 Accepts an extra option, ``prepopulate_from``, which is a list of fields
