Changeset 5509
- Timestamp:
- 06/21/07 16:36:35 (1 year ago)
- Files:
-
- django/branches/boulder-oracle-sprint/AUTHORS (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/admin/media/js/admin/RelatedObjectLookups.js (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/contrib/auth/forms.py (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/databrowse/templates/databrowse/object_detail.html (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/contrib/redirects/middleware.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/core/servers/basehttp.py (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/docs/install.txt (modified) (4 diffs)
- django/branches/boulder-oracle-sprint/docs/model-api.txt (modified) (1 diff)
- django/branches/boulder-oracle-sprint/docs/newforms.txt (modified) (1 diff)
- django/branches/boulder-oracle-sprint/docs/tutorial01.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/boulder-oracle-sprint/AUTHORS
r5491 r5509 101 101 favo@exoweb.net 102 102 Bill Fenner <fenner@gmail.com> 103 Stefane Fermgier <sf@fermigier.com> 103 104 Matthew Flanagan <http://wadofstuff.blogspot.com> 104 105 Eric Floehr <eric@intellovations.com> … … 106 107 gandalf@owca.info 107 108 Baishampayan Ghose 109 glin@seznam.cz 108 110 martin.glueck@gmail.com 109 111 GomoX <gomo@datafull.com> django/branches/boulder-oracle-sprint/django/contrib/admin/media/js/admin/RelatedObjectLookups.js
r3517 r5509 31 31 var name = triggeringLink.id.replace(/^add_/, ''); 32 32 name = name.replace(/\./g, '___'); 33 var win = window.open(triggeringLink.href + '?_popup=1', name, 'height=500,width=800,resizable=yes,scrollbars=yes'); 33 href = triggeringLink.href 34 if (href.indexOf('?') == -1) 35 href += '?_popup=1'; 36 else 37 href += '&_popup=1'; 38 var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); 34 39 win.focus(); 35 40 return false; django/branches/boulder-oracle-sprint/django/contrib/auth/forms.py
r4695 r5509 80 80 def isValidUserEmail(self, new_data, all_data): 81 81 "Validates that a user exists with the given e-mail address" 82 try: 83 self.user_cache = User.objects.get(email__iexact=new_data) 84 except User.DoesNotExist: 82 self.users_cache = list(User.objects.filter(email__iexact=new_data)) 83 if len(self.users_cache) == 0: 85 84 raise validators.ValidationError, _("That e-mail address doesn't have an associated user account. Are you sure you've registered?") 86 85 … … 88 87 "Calculates a new password randomly and sends it to the user" 89 88 from django.core.mail import send_mail 90 new_pass = User.objects.make_random_password() 91 self.user_cache.set_password(new_pass) 92 self.user_cache.save() 93 if not domain_override: 94 current_site = Site.objects.get_current() 95 site_name = current_site.name 96 domain = current_site.domain 97 else: 98 site_name = domain = domain_override 99 t = loader.get_template(email_template_name) 100 c = { 101 'new_password': new_pass, 102 'email': self.user_cache.email, 103 'domain': domain, 104 'site_name': site_name, 105 'user': self.user_cache, 106 } 107 send_mail('Password reset on %s' % site_name, t.render(Context(c)), None, [self.user_cache.email]) 89 for user in self.users_cache: 90 new_pass = User.objects.make_random_password() 91 user.set_password(new_pass) 92 user.save() 93 if not domain_override: 94 current_site = Site.objects.get_current() 95 site_name = current_site.name 96 domain = current_site.domain 97 else: 98 site_name = domain = domain_override 99 t = loader.get_template(email_template_name) 100 c = { 101 'new_password': new_pass, 102 'email': user.email, 103 'domain': domain, 104 'site_name': site_name, 105 'user': user, 106 } 107 send_mail('Password reset on %s' % site_name, t.render(Context(c)), None, [user.email]) 108 108 109 109 class PasswordChangeForm(oldforms.Manipulator): django/branches/boulder-oracle-sprint/django/contrib/databrowse/templates/databrowse/object_detail.html
r5014 r5509 33 33 {% endfor %} 34 34 </ul> 35 </div>36 35 {% else %} 37 36 <p class="quiet">(None)</p> 38 37 {% endif %} 38 </div> 39 39 {% endfor %} 40 40 django/branches/boulder-oracle-sprint/django/contrib/redirects/middleware.py
r4279 r5509 20 20 pass 21 21 if r is not None: 22 if r == '':22 if r.new_path == '': 23 23 return http.HttpResponseGone() 24 24 return http.HttpResponsePermanentRedirect(r.new_path) django/branches/boulder-oracle-sprint/django/core/servers/basehttp.py
r5491 r5509 10 10 from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer 11 11 from types import ListType, StringType 12 import os, re, sys, time, urllib 12 import os, re, sys, time, urllib, mimetypes 13 13 14 14 __version__ = "0.1" … … 630 630 status = '200 OK' 631 631 headers = {} 632 mime_type = mimetypes.guess_type(file_path)[0] 633 if mime_type: 634 headers['Content-Type'] = mime_type 632 635 output = [fp.read()] 633 636 fp.close() django/branches/boulder-oracle-sprint/docs/install.txt
r5384 r5509 18 18 ============================= 19 19 20 If you just want to experiment with Django, skip this step. Django comes with 21 its own Web server for development purposes. 20 If you just want to experiment with Django, skip ahead to the next 21 section; Django includes a lightweight web server you can use for 22 testing, so you won't need to set up Apache until you're ready to 23 deploy Django in production. 22 24 23 25 If you want to use Django on a production site, use Apache with `mod_python`_. … … 87 89 ``site-packages``. 88 90 89 If you installed Django from a Python Egg, remove the Django ``.egg`` file,91 If you installed Django from a Python egg, remove the Django ``.egg`` file, 90 92 and remove the reference to the egg in the file named ``easy-install.pth``. 91 93 This file should also be located in your ``site-packages`` directory. … … 94 96 95 97 The location of the ``site-packages`` directory depends on the operating 96 system, and the location in which Python was installed. However, the97 following locations are common:98 system, and the location in which Python was installed. To find out your 99 system's ``site-packages`` location, execute the following:: 98 100 99 * If you're using Linux: ``/usr/lib/python2.X/site-packages``101 python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" 100 102 101 * If you're using Windows: ``C:\Python2.X\lib\site-packages`` 102 103 * If you're using MacOSX: ``/Library/Python2.X/site-packages`` or 104 ``/Library/Frameworks/Python.framework/Versions/2.X/lib/python2.X/site-packages/`` 105 (in later releases). 103 (Note that this should be run from a shell prompt, not a Python interactive 104 prompt.) 106 105 107 106 Install the Django code … … 142 141 1. Make sure you have Subversion_ installed. 143 142 2. Check out the Django code into your Python ``site-packages`` directory. 143 144 144 On Linux / Mac OSX / Unix, do this:: 145 145 146 146 svn co http://code.djangoproject.com/svn/django/trunk/ django_src 147 ln -s `pwd`/django_src/django /usr/lib/python2.3/site-packages/django147 ln -s `pwd`/django_src/django SITE-PACKAGES-DIR/django 148 148 149 (In the above line, change ``python2.3`` to match your current Python version.) 149 (In the above line, change ``SITE-PACKAGES-DIR`` to match the location of 150 your system's ``site-packages`` directory, as explained in the 151 "Where are my ``site-packages`` stored?" section above.) 150 152 151 153 On Windows, do this:: django/branches/boulder-oracle-sprint/docs/model-api.txt
r5463 r5509 1894 1894 1895 1895 A final note: If all you want to do is a custom ``WHERE`` clause, you can just 1896 justthe ``where``, ``tables`` and ``params`` arguments to the standard lookup1896 use the ``where``, ``tables`` and ``params`` arguments to the standard lookup 1897 1897 API. See `Other lookup options`_. 1898 1898 1899 1899 .. _Python DB-API: http://www.python.org/peps/pep-0249.html 1900 .. _Other lookup options: ../db-api/#extra- params-select-where-tables1900 .. _Other lookup options: ../db-api/#extra-select-none-where-none-params-none-tables-none 1901 1901 .. _transaction handling: ../transactions/ 1902 1902 django/branches/boulder-oracle-sprint/docs/newforms.txt
r5491 r5509 111 111 --------------------------- 112 112 113 A ``Form`` instance is either **bound** or **unbound** to a set of data.113 A ``Form`` instance is either **bound** to a set of data, or **unbound**. 114 114 115 115 * If it's **bound** to a set of data, it's capable of validating that data django/branches/boulder-oracle-sprint/docs/tutorial01.txt
r5079 r5509 11 11 12 12 * A public site that lets people view polls and vote in them. 13 * An admin site that lets you add, change and delete poll .13 * An admin site that lets you add, change and delete polls. 14 14 15 15 We'll assume you have `Django installed`_ already. You can tell Django is
