Changeset 7604
- Timestamp:
- 06/09/08 23:03:09 (6 months ago)
- Files:
-
- django/branches/newforms-admin (modified) (1 prop)
- django/branches/newforms-admin/AUTHORS (modified) (3 diffs)
- django/branches/newforms-admin/django/conf/global_settings.py (modified) (1 diff)
- django/branches/newforms-admin/django/contrib/auth/create_superuser.py (modified) (1 diff)
- django/branches/newforms-admin/django/contrib/auth/management (copied) (copied from django/trunk/django/contrib/auth/management)
- django/branches/newforms-admin/django/contrib/auth/management/commands (copied) (copied from django/trunk/django/contrib/auth/management/commands)
- django/branches/newforms-admin/django/contrib/auth/management/commands/createsuperuser.py (copied) (copied from django/trunk/django/contrib/auth/management/commands/createsuperuser.py)
- django/branches/newforms-admin/django/contrib/auth/management/commands/__init__.py (copied) (copied from django/trunk/django/contrib/auth/management/commands/__init__.py)
- django/branches/newforms-admin/django/contrib/auth/management/__init__.py (copied) (copied from django/trunk/django/contrib/auth/management/__init__.py)
- django/branches/newforms-admin/django/contrib/auth/management.py (deleted)
- django/branches/newforms-admin/django/contrib/auth/models.py (modified) (1 diff)
- django/branches/newforms-admin/django/contrib/auth/tests/basic.py (modified) (1 diff)
- django/branches/newforms-admin/django/contrib/sessions/backends/base.py (modified) (2 diffs)
- django/branches/newforms-admin/django/contrib/sessions/backends/cache.py (modified) (3 diffs)
- django/branches/newforms-admin/django/contrib/sessions/backends/db.py (modified) (1 diff)
- django/branches/newforms-admin/django/contrib/sessions/middleware.py (modified) (1 diff)
- django/branches/newforms-admin/django/contrib/sessions/tests.py (modified) (1 diff)
- django/branches/newforms-admin/django/core/management/commands/loaddata.py (modified) (6 diffs)
- django/branches/newforms-admin/django/core/management/sql.py (modified) (1 diff)
- django/branches/newforms-admin/django/core/serializers/base.py (modified) (1 diff)
- django/branches/newforms-admin/django/db/models/base.py (modified) (1 diff)
- django/branches/newforms-admin/django/db/models/options.py (modified) (2 diffs)
- django/branches/newforms-admin/django/db/models/query.py (modified) (2 diffs)
- django/branches/newforms-admin/django/db/models/sql/query.py (modified) (4 diffs)
- django/branches/newforms-admin/docs/authentication.txt (modified) (1 diff)
- django/branches/newforms-admin/docs/django-admin.txt (modified) (1 diff)
- django/branches/newforms-admin/docs/faq.txt (modified) (5 diffs)
- django/branches/newforms-admin/docs/serialization.txt (modified) (1 diff)
- django/branches/newforms-admin/docs/sessions.txt (modified) (5 diffs)
- django/branches/newforms-admin/tests/modeltests/model_inheritance/models.py (modified) (1 diff)
- django/branches/newforms-admin/tests/modeltests/update/models.py (modified) (1 diff)
- django/branches/newforms-admin/tests/regressiontests/fixtures_regress/fixtures/bad_fixture1.unkn (copied) (copied from django/trunk/tests/regressiontests/fixtures_regress/fixtures/bad_fixture1.unkn)
- django/branches/newforms-admin/tests/regressiontests/fixtures_regress/fixtures/bad_fixture2.xml (copied) (copied from django/trunk/tests/regressiontests/fixtures_regress/fixtures/bad_fixture2.xml)
- django/branches/newforms-admin/tests/regressiontests/fixtures_regress/models.py (modified) (1 diff)
- django/branches/newforms-admin/tests/regressiontests/model_inheritance_regress (copied) (copied from django/trunk/tests/regressiontests/model_inheritance_regress)
- django/branches/newforms-admin/tests/regressiontests/model_inheritance_regress/__init__.py (copied) (copied from django/trunk/tests/regressiontests/model_inheritance_regress/__init__.py)
- django/branches/newforms-admin/tests/regressiontests/model_inheritance_regress/models.py (copied) (copied from django/trunk/tests/regressiontests/model_inheritance_regress/models.py)
- django/branches/newforms-admin/tests/regressiontests/null_fk (copied) (copied from django/trunk/tests/regressiontests/null_fk)
- django/branches/newforms-admin/tests/regressiontests/null_fk/__init__.py (copied) (copied from django/trunk/tests/regressiontests/null_fk/__init__.py)
- django/branches/newforms-admin/tests/regressiontests/null_fk/models.py (copied) (copied from django/trunk/tests/regressiontests/null_fk/models.py)
- django/branches/newforms-admin/tests/regressiontests/serializers_regress/models.py (modified) (1 diff)
- django/branches/newforms-admin/tests/regressiontests/serializers_regress/tests.py (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/newforms-admin
- Property svnmerge-integrated changed from /django/trunk:1-4345,4350-4357,4359-4365,4371-4372,4374-4377,4380-4386,4388,4390-4391,4400-4402,4404-4408,4410,4412-4419,4426-4427,4430-4432,4434,4441,4443-4444,4446-4447,4450,4452-4453,4455-4458,4476,4503,4546,4564-4569,4580-4586,4617,4630,4641-6390,6392-7583 to /django/trunk:1-4345,4350-4357,4359-4365,4371-4372,4374-4377,4380-4386,4388,4390-4391,4400-4402,4404-4408,4410,4412-4419,4426-4427,4430-4432,4434,4441,4443-4444,4446-4447,4450,4452-4453,4455-4458,4476,4503,4546,4564-4569,4580-4586,4617,4630,4641-6390,6392-7603
django/branches/newforms-admin/AUTHORS
r7584 r7604 58 58 Jökull Sólberg Auðunsson <jokullsolberg@gmail.com> 59 59 Arthur <avandorp@gmail.com> 60 av0000@mail.ru 60 61 David Avsajanishvili <avsd05@gmail.com> 61 62 axiak@mit.edu … … 80 81 btoll@bestweb.net 81 82 Jonathan Buchanan <jonathan.buchanan@gmail.com> 83 Keith Bussell <kbussell@gmail.com> 82 84 Juan Manuel Caicedo <juan.manuel.caicedo@gmail.com> 83 85 Trevor Caira <trevor@caira.com> … … 369 371 tt@gurgle.no 370 372 David Tulig <david.tulig@gmail.com> 371 Amit Upadhyay 373 Amit Upadhyay <http://www.amitu.com/blog/> 372 374 Geert Vanderkelen 373 375 I.S. van Oostveen <v.oostveen@idca.nl> django/branches/newforms-admin/django/conf/global_settings.py
r7544 r7604 290 290 SESSION_COOKIE_PATH = '/' # The path of the session cookie. 291 291 SESSION_SAVE_EVERY_REQUEST = False # Whether to save the session data on every request. 292 SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether sessions expire when a user closes hisbrowser.292 SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether a user's session cookie expires when they close their browser. 293 293 SESSION_ENGINE = 'django.contrib.sessions.backends.db' # The module to store session data 294 294 SESSION_FILE_PATH = None # Directory to store session files if using the file session module. If None, the backend will use a sensible default. django/branches/newforms-admin/django/contrib/auth/create_superuser.py
r7022 r7604 1 1 """ 2 Helper function for creating superusers in the authentication system. 3 4 If run from the command line, this module lets you create a superuser 5 interactively. 2 Create a superuser from the command line. Deprecated; use manage.py 3 createsuperuser instead. 6 4 """ 7 5 8 from django.core import validators9 from django.contrib.auth.models import User10 import getpass11 import os12 import sys13 import re14 15 RE_VALID_USERNAME = re.compile('\w+$')16 17 def createsuperuser(username=None, email=None, password=None):18 """19 Helper function for creating a superuser from the command line. All20 arguments are optional and will be prompted-for if invalid or not given.21 """22 try:23 import pwd24 except ImportError:25 default_username = ''26 else:27 # Determine the current system user's username, to use as a default.28 default_username = pwd.getpwuid(os.getuid())[0].replace(' ', '').lower()29 30 # Determine whether the default username is taken, so we don't display31 # it as an option.32 if default_username:33 try:34 User.objects.get(username=default_username)35 except User.DoesNotExist:36 pass37 else:38 default_username = ''39 40 try:41 while 1:42 if not username:43 input_msg = 'Username'44 if default_username:45 input_msg += ' (Leave blank to use %r)' % default_username46 username = raw_input(input_msg + ': ')47 if default_username and username == '':48 username = default_username49 if not RE_VALID_USERNAME.match(username):50 sys.stderr.write("Error: That username is invalid. Use only letters, digits and underscores.\n")51 username = None52 continue53 try:54 User.objects.get(username=username)55 except User.DoesNotExist:56 break57 else:58 sys.stderr.write("Error: That username is already taken.\n")59 username = None60 while 1:61 if not email:62 email = raw_input('E-mail address: ')63 try:64 validators.isValidEmail(email, None)65 except validators.ValidationError:66 sys.stderr.write("Error: That e-mail address is invalid.\n")67 email = None68 else:69 break70 while 1:71 if not password:72 password = getpass.getpass()73 password2 = getpass.getpass('Password (again): ')74 if password != password2:75 sys.stderr.write("Error: Your passwords didn't match.\n")76 password = None77 continue78 if password.strip() == '':79 sys.stderr.write("Error: Blank passwords aren't allowed.\n")80 password = None81 continue82 break83 except KeyboardInterrupt:84 sys.stderr.write("\nOperation cancelled.\n")85 sys.exit(1)86 u = User.objects.create_user(username, email, password)87 u.is_staff = True88 u.is_active = True89 u.is_superuser = True90 u.save()91 print "Superuser created successfully."92 93 6 if __name__ == "__main__": 94 createsuperuser() 7 from django.core.management import call_command 8 call_command("createsuperuser") django/branches/newforms-admin/django/contrib/auth/models.py
r7436 r7604 114 114 return user 115 115 116 def create_superuser(self, username, email, password): 117 u = self.create_user(username, email, password) 118 u.is_staff = True 119 u.is_active = True 120 u.is_superuser = True 121 u.save() 122 116 123 def make_random_password(self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'): 117 124 "Generates a random password with the given length and given allowed_chars" django/branches/newforms-admin/django/contrib/auth/tests/basic.py
r7191 r7604 37 37 >>> a.user_permissions.all() 38 38 [] 39 40 # 41 # Tests for createsuperuser management command. 42 # It's nearly impossible to test the interactive mode -- a command test helper 43 # would be needed (and *awesome*) -- so just test the non-interactive mode. 44 # This covers most of the important validation, but not all. 45 # 46 >>> from django.core.management import call_command 47 48 >>> call_command("createsuperuser", noinput=True, username="joe", email="joe@somewhere.org") 49 Superuser created successfully. 50 51 >>> u = User.objects.get(username="joe") 52 >>> u.email 53 u'joe@somewhere.org' 54 >>> u.password 55 u'!' 39 56 """ django/branches/newforms-admin/django/contrib/sessions/backends/base.py
r7351 r7604 5 5 import sys 6 6 import time 7 from datetime import datetime, timedelta 7 8 from django.conf import settings 8 9 from django.core.exceptions import SuspiciousOperation … … 129 130 _session = property(_get_session) 130 131 132 def get_expiry_age(self): 133 """Get the number of seconds until the session expires.""" 134 expiry = self.get('_session_expiry') 135 if not expiry: # Checks both None and 0 cases 136 return settings.SESSION_COOKIE_AGE 137 if not isinstance(expiry, datetime): 138 return expiry 139 delta = expiry - datetime.now() 140 return delta.days * 86400 + delta.seconds 141 142 def get_expiry_date(self): 143 """Get session the expiry date (as a datetime object).""" 144 expiry = self.get('_session_expiry') 145 if isinstance(expiry, datetime): 146 return expiry 147 if not expiry: # Checks both None and 0 cases 148 expiry = settings.SESSION_COOKIE_AGE 149 return datetime.now() + timedelta(seconds=expiry) 150 151 def set_expiry(self, value): 152 """ 153 Sets a custom expiration for the session. ``value`` can be an integer, a 154 Python ``datetime`` or ``timedelta`` object or ``None``. 155 156 If ``value`` is an integer, the session will expire after that many 157 seconds of inactivity. If set to ``0`` then the session will expire on 158 browser close. 159 160 If ``value`` is a ``datetime`` or ``timedelta`` object, the session 161 will expire at that specific future time. 162 163 If ``value`` is ``None``, the session uses the global session expiry 164 policy. 165 """ 166 if value is None: 167 # Remove any custom expiration for this session. 168 try: 169 del self['_session_expiry'] 170 except KeyError: 171 pass 172 return 173 if isinstance(value, timedelta): 174 value = datetime.now() + value 175 self['_session_expiry'] = value 176 177 def get_expire_at_browser_close(self): 178 """ 179 Returns ``True`` if the session is set to expire when the browser 180 closes, and ``False`` if there's an expiry date. Use 181 ``get_expiry_date()`` or ``get_expiry_age()`` to find the actual expiry 182 date/age, if there is one. 183 """ 184 if self.get('_session_expiry') is None: 185 return settings.SESSION_EXPIRE_AT_BROWSER_CLOSE 186 return self.get('_session_expiry') == 0 187 131 188 # Methods that child classes must implement. 132 189 django/branches/newforms-admin/django/contrib/sessions/backends/cache.py
r7351 r7604 5 5 class SessionStore(SessionBase): 6 6 """ 7 A cache-based session store. 7 A cache-based session store. 8 8 """ 9 9 def __init__(self, session_key=None): 10 10 self._cache = cache 11 11 super(SessionStore, self).__init__(session_key) 12 12 13 13 def load(self): 14 14 session_data = self._cache.get(self.session_key) … … 16 16 17 17 def save(self): 18 self._cache.set(self.session_key, self._session, se ttings.SESSION_COOKIE_AGE)18 self._cache.set(self.session_key, self._session, self.get_expiry_age()) 19 19 20 20 def exists(self, session_key): … … 22 22 return True 23 23 return False 24 24 25 25 def delete(self, session_key): 26 26 self._cache.delete(session_key) django/branches/newforms-admin/django/contrib/sessions/backends/db.py
r7351 r7604 42 42 session_key = self.session_key, 43 43 session_data = self.encode(self._session), 44 expire_date = datetime.datetime.now() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE)44 expire_date = self.get_expiry_date() 45 45 ) 46 46 django/branches/newforms-admin/django/contrib/sessions/middleware.py
r6656 r7604 27 27 patch_vary_headers(response, ('Cookie',)) 28 28 if modified or settings.SESSION_SAVE_EVERY_REQUEST: 29 if settings.SESSION_EXPIRE_AT_BROWSER_CLOSE:29 if request.session.get_expire_at_browser_close(): 30 30 max_age = None 31 31 expires = None 32 32 else: 33 max_age = settings.SESSION_COOKIE_AGE34 expires_time = time.time() + settings.SESSION_COOKIE_AGE33 max_age = request.session.get_expiry_age() 34 expires_time = time.time() + max_age 35 35 expires = cookie_date(expires_time) 36 # Save the se esion data and refresh the client cookie.36 # Save the session data and refresh the client cookie. 37 37 request.session.save() 38 38 response.set_cookie(settings.SESSION_COOKIE_NAME, django/branches/newforms-admin/django/contrib/sessions/tests.py
r6955 r7604 89 89 >>> s.pop('some key', 'does not exist') 90 90 'does not exist' 91 92 ######################### 93 # Custom session expiry # 94 ######################### 95 96 >>> from django.conf import settings 97 >>> from datetime import datetime, timedelta 98 99 >>> td10 = timedelta(seconds=10) 100 101 # A normal session has a max age equal to settings 102 >>> s.get_expiry_age() == settings.SESSION_COOKIE_AGE 103 True 104 105 # So does a custom session with an idle expiration time of 0 (but it'll expire 106 # at browser close) 107 >>> s.set_expiry(0) 108 >>> s.get_expiry_age() == settings.SESSION_COOKIE_AGE 109 True 110 111 # Custom session idle expiration time 112 >>> s.set_expiry(10) 113 >>> delta = s.get_expiry_date() - datetime.now() 114 >>> delta.seconds in (9, 10) 115 True 116 >>> age = s.get_expiry_age() 117 >>> age in (9, 10) 118 True 119 120 # Custom session fixed expiry date (timedelta) 121 >>> s.set_expiry(td10) 122 >>> delta = s.get_expiry_date() - datetime.now() 123 >>> delta.seconds in (9, 10) 124 True 125 >>> age = s.get_expiry_age() 126 >>> age in (9, 10) 127 True 128 129 # Custom session fixed expiry date (fixed datetime) 130 >>> s.set_expiry(datetime.now() + td10) 131 >>> delta = s.get_expiry_date() - datetime.now() 132 >>> delta.seconds in (9, 10) 133 True 134 >>> age = s.get_expiry_age() 135 >>> age in (9, 10) 136 True 137 138 # Set back to default session age 139 >>> s.set_expiry(None) 140 >>> s.get_expiry_age() == settings.SESSION_COOKIE_AGE 141 True 142 143 # Allow to set back to default session age even if no alternate has been set 144 >>> s.set_expiry(None) 145 146 147 # We're changing the setting then reverting back to the original setting at the 148 # end of these tests. 149 >>> original_expire_at_browser_close = settings.SESSION_EXPIRE_AT_BROWSER_CLOSE 150 >>> settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = False 151 152 # Custom session age 153 >>> s.set_expiry(10) 154 >>> s.get_expire_at_browser_close() 155 False 156 157 # Custom expire-at-browser-close 158 >>> s.set_expiry(0) 159 >>> s.get_expire_at_browser_close() 160 True 161 162 # Default session age 163 >>> s.set_expiry(None) 164 >>> s.get_expire_at_browser_close() 165 False 166 167 >>> settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = True 168 169 # Custom session age 170 >>> s.set_expiry(10) 171 >>> s.get_expire_at_browser_close() 172 False 173 174 # Custom expire-at-browser-close 175 >>> s.set_expiry(0) 176 >>> s.get_expire_at_browser_close() 177 True 178 179 # Default session age 180 >>> s.set_expiry(None) 181 >>> s.get_expire_at_browser_close() 182 True 183 184 >>> settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = original_expire_at_browser_close 91 185 """ 92 186 django/branches/newforms-admin/django/core/management/commands/loaddata.py
r7351 r7604 33 33 fixture_count = 0 34 34 object_count = 0 35 objects_per_fixture = [] 35 36 models = set() 36 37 … … 61 62 formats = [] 62 63 63 if verbosity >= 2:64 if formats:64 if formats: 65 if verbosity > 1: 65 66 print "Loading '%s' fixtures..." % fixture_name 66 else: 67 print "Skipping fixture '%s': %s is not a known serialization format" % (fixture_name, format) 67 else: 68 sys.stderr.write( 69 self.style.ERROR("Problem installing fixture '%s': %s is not a known serialization format." % 70 (fixture_name, format))) 71 transaction.rollback() 72 transaction.leave_transaction_management() 73 return 68 74 69 75 if os.path.isabs(fixture_name): … … 94 100 else: 95 101 fixture_count += 1 102 objects_per_fixture.append(0) 96 103 if verbosity > 0: 97 104 print "Installing %s fixture '%s' from %s." % \ … … 101 108 for obj in objects: 102 109 object_count += 1 110 objects_per_fixture[-1] += 1 103 111 models.add(obj.object.__class__) 104 112 obj.save() … … 118 126 fixture.close() 119 127 except: 120 if verbosity > = 2:128 if verbosity > 1: 121 129 print "No %s fixture '%s' in %s." % \ 122 130 (format, fixture_name, humanize(fixture_dir)) 123 131 132 133 # If any of the fixtures we loaded contain 0 objects, assume that an 134 # error was encountered during fixture loading. 135 if 0 in objects_per_fixture: 136 sys.stderr.write( 137 self.style.ERROR("No fixture data found for '%s'. (File format may be invalid.)" % 138 (fixture_name))) 139 transaction.rollback() 140 transaction.leave_transaction_management() 141 return 142 143 # If we found even one object in a fixture, we need to reset the 144 # database sequences. 124 145 if object_count > 0: 125 146 sequence_sql = connection.ops.sequence_reset_sql(self.style, models) … … 129 150 for line in sequence_sql: 130 151 cursor.execute(line) 131 152 132 153 transaction.commit() 133 154 transaction.leave_transaction_management() 134 155 135 156 if object_count == 0: 136 if verbosity > = 2:157 if verbosity > 1: 137 158 print "No fixtures found." 138 159 else: django/branches/newforms-admin/django/core/management/sql.py
r7584 r7604 447 447 for statement in statements.split(fp.read().decode(settings.FILE_CHARSET)): 448 448 # Remove any comments from the file 449 statement = re.sub(ur"--.* [\n\Z]", "", statement)449 statement = re.sub(ur"--.*([\n\Z]|$)", "", statement) 450 450 if statement.strip(): 451 451 output.append(statement + u";") django/branches/newforms-admin/django/core/serializers/base.py
r7479 r7604 39 39 for obj in queryset: 40 40 self.start_object(obj) 41 for field in obj._meta. fields:41 for field in obj._meta.local_fields: 42 42 if field.serialize: 43 43 if field.rel is None: django/branches/newforms-admin/django/db/models/base.py
r7533 r7604 288 288 signal = False 289 289 290 for parent, field in meta.parents.items(): 291 self.save_base(raw, parent) 292 setattr(self, field.attname, self._get_pk_val(parent._meta)) 290 # If we are in a raw save, save the object exactly as presented. 291 # That means that we don't try to be smart about saving attributes 292 # that might have come from the parent class - we just save the 293 # attributes we have been given to the class we have been given. 294 if not raw: 295 for parent, field in meta.parents.items(): 296 self.save_base(raw, parent) 297 setattr(self, field.attname, self._get_pk_val(parent._meta)) 293 298 294 299 non_pks = [f for f in meta.local_fields if not f.primary_key] 295 300 296 301 # First, try an UPDATE. If that doesn't update anything, do an INSERT. 297 302 pk_val = self._get_pk_val(meta) django/branches/newforms-admin/django/db/models/options.py
r7479 r7604 56 56 if self.meta: 57 57 meta_attrs = self.meta.__dict__.copy() 58 del meta_attrs['__module__'] 59 del meta_attrs['__doc__'] 58 for name in self.meta.__dict__: 59 # Ignore any private attributes that Django doesn't care about. 60 # NOTE: We can't modify a dictionary's contents while looping 61 # over it, so we loop over the *original* dictionary instead. 62 if name.startswith('_'): 63 del meta_attrs[name] 60 64 for attr_name in DEFAULT_NAMES: 61 65 if attr_name in meta_attrs: … … 98 102 field = self.parents.value_for_index(0) 99 103 field.primary_key = True 100 self. pk = field104 self.setup_pk(field) 101 105 else: 102 106 auto = AutoField(verbose_name='ID', primary_key=True, django/branches/newforms-admin/django/db/models/query.py
r7533 r7604 293 293 fields to the appropriate values. 294 294 """ 295 assert self.query.can_filter(), \ 296 "Cannot update a query once a slice has been taken." 295 297 query = self.query.clone(sql.UpdateQuery) 296 298 query.add_update_values(kwargs) … … 307 309 useful at that level). 308 310 """ 311 assert self.query.can_filter(), \ 312 "Cannot update a query once a slice has been taken." 309 313 query = self.query.clone(sql.UpdateQuery) 310 314 query.add_update_fields(values) django/branches/newforms-admin/django/db/models/sql/query.py
r7533 r7604 852 852 853 853 def fill_related_selections(self, opts=None, root_alias=None, cur_depth=1, 854 used=None, requested=None, restricted=None ):854 used=None, requested=None, restricted=None, nullable=None): 855 855 """ 856 856 Fill in the information needed for a select_related query. The current … … 884 884 continue 885 885 table = f.rel.to._meta.db_table 886 if nullable or f.null: 887 promote = True 888 else: 889 promote = False 886 890 if model: 887 891 int_opts = opts … … 892 896 alias = self.join((alias, int_opts.db_table, lhs_col, 893 897 int_opts.pk.column), exclusions=used, 894 promote= f.null)898 promote=promote) 895 899 else: 896 900 alias = root_alias 897 901 alias = self.join((alias, table, f.column, 898 902 f.rel.get_related_field().column), exclusions=used, 899 promote= f.null)903 promote=promote) 900 904 used.add(alias) 901 905 self.related_select_cols.extend([(alias, f2.column) … … 906 910 else: 907 911 next = False 912 if f.null is not None: 913 new_nullable = f.null 914 else: 915 new_nullable = None 908 916 self.fill_related_selections(f.rel.to._meta, alias, cur_depth + 1, 909 used, next, restricted )917 used, next, restricted, new_nullable) 910 918 911 919 def add_filter(self, filter_expr, connector=AND, negate=False, trim=False, django/branches/newforms-admin/docs/authentication.txt
r7436 r7604 264 264 265 265 ``manage.py syncdb`` prompts you to create a superuser the first time you run 266 it after adding ``'django.contrib.auth'`` to your ``INSTALLED_APPS``. But if 267 you need to create a superuser after that via the command line, you can use the 268 ``create_superuser.py`` utility. Just run this command:: 266 it after adding ``'django.contrib.auth'`` to your ``INSTALLED_APPS``. If you need 267 to create a superuser at a later date, you can use a command line utility. 268 269 **New in Django development version.**:: 270 271 manage.py createsuperuser --username=joe --email=joe@example.com 272 273 You will be prompted for a password. Once entered, the user is created. If you 274 leave off the ``--username`` or the ``--email`` option, It will prompt you for 275 those values as well. 276 277 If you're using an older release of Django, the old way of creating a superuser 278 on the command line still works:: 269 279 270 280 python /path/to/django/contrib/auth/create_superuser.py 271 281 272 Make sure to substitute ``/path/to/`` with the path to the Django codebase on 273 your filesystem. 282 Where ``/path/to`` is the path to the Django codebase on your filesystem. The 283 ``manage.py`` command is prefered since it'll figure out the correct path and 284 environment for you. 274 285 275 286 Storing additional information about users django/branches/newforms-admin/docs/django-admin.txt
r7351 r7604 109 109 the right place. There's no way to specify the location of the program 110 110 manually. 111 112 createsuperuser 113 --------------- 114 115 **New in Django development version** 116 117 Creates a superuser account (a user who has all permissions). This is 118 useful if you need to create an initial superuser account but did not 119 do so during ``syncdb``, or if you need to programmatically generate 120 superuser accounts for your site(s). 121 122 When run interactively, this command will prompt for a password for 123 the new superuser account; when run non-interactively, no password 124 will be set and the superuser account will not be able to log in until 125 a password has been manually set for it. 126 127 The username and e-mail address for the new account can be supplied by 128 using the ``--username`` and ``--email`` arguments on the command 129 line; if not supplied, ``createsuperuser`` will prompt for them when 130 running interactively. 131 132 This command is only available if Django's `authentication system`_ 133 (``django.contrib.auth``) is installed. 134 135 .. _authentication system: ../authentication/ 111 136 112 137 diffsettings django/branches/newforms-admin/docs/faq.txt
r7351 r7604 229 229 begin maintaining backwards compatibility. 230 230 231 The merging of Django's ` magic-removalbranch`_ went a long way toward Django232 1.0. 231 The merging of Django's `Queryset Refactor branch`_ went a long way toward Django 232 1.0. Merging the `Newforms Admin branch` will be another important step. 233 233 234 234 Of course, you should note that `quite a few production sites`_ use Django in 235 235 its current status. Don't let the lack of a 1.0 turn you off. 236 236 237 .. _magic-removal branch: http://code.djangoproject.com/wiki/RemovingTheMagic 237 .. _Queryset Refactor branch: http://code.djangoproject.com/wiki/QuerysetRefactorBranch 238 .. _Newforms Admin branch: http://code.djangoproject.com/wiki/NewformsAdminBranch 238 239 .. _quite a few production sites: http://code.djangoproject.com/wiki/DjangoPoweredSites 239 240 … … 260 261 would be happy to help you. 261 262 262 You might also be interested in posting a job to http://www.gypsyjobs.com/ . 263 You might also be interested in posting a job to http://djangogigs.com/ . 264 If you want to find Django-capable people in your local area, try 265 http://djangopeople.net/ . 263 266 264 267 .. _developers for hire page: http://code.djangoproject.com/wiki/DevelopersForHire … … 644 647 .. _creating users: ../authentication/#creating-users 645 648 649 Getting Help 650 ============ 651 652 How do I do X? Why doesn't Y work? Where can I go to get help? 653 -------------------------------------------------------------- 654 655 If this FAQ doesn't contain an answer to your question, you might want to 656 try the `django-users mailing list`_. Feel free to ask any question related 657 to installing, using, or debugging Django. 658 659 If you prefer IRC, the `#django IRC channel`_ on freenode is an active 660 community of helpful individuals who may be able to solve your problem. 661 662 .. _`django-users mailing list`: http://groups.google.com/group/django-users 663 .. _`#django IRC channel`: irc://irc.freenode.net/django 664 665 Why hasn't my message appeared on django-users? 666 ----------------------------------------------- 667 668 django-users_ has a lot of subscribers. This is good for the community, as 669 there are lot of people that
