Django

Code

Show
Ignore:
Timestamp:
06/21/07 16:36:35 (2 years ago)
Author:
bouldersprinters
Message:

boulder-oracle-sprint: Merged to [5508]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/boulder-oracle-sprint/AUTHORS

    r5491 r5509  
    101101    favo@exoweb.net 
    102102    Bill Fenner <fenner@gmail.com> 
     103    Stefane Fermgier <sf@fermigier.com> 
    103104    Matthew Flanagan <http://wadofstuff.blogspot.com> 
    104105    Eric Floehr <eric@intellovations.com> 
     
    106107    gandalf@owca.info 
    107108    Baishampayan Ghose 
     109    glin@seznam.cz 
    108110    martin.glueck@gmail.com 
    109111    GomoX <gomo@datafull.com> 
  • django/branches/boulder-oracle-sprint/django/contrib/admin/media/js/admin/RelatedObjectLookups.js

    r3517 r5509  
    3131    var name = triggeringLink.id.replace(/^add_/, ''); 
    3232    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'); 
    3439    win.focus(); 
    3540    return false; 
  • django/branches/boulder-oracle-sprint/django/contrib/auth/forms.py

    r4695 r5509  
    8080    def isValidUserEmail(self, new_data, all_data): 
    8181        "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: 
    8584            raise validators.ValidationError, _("That e-mail address doesn't have an associated user account. Are you sure you've registered?") 
    8685 
     
    8887        "Calculates a new password randomly and sends it to the user" 
    8988        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]) 
    108108 
    109109class PasswordChangeForm(oldforms.Manipulator): 
  • django/branches/boulder-oracle-sprint/django/contrib/databrowse/templates/databrowse/object_detail.html

    r5014 r5509  
    3333    {% endfor %} 
    3434  </ul> 
    35   </div> 
    3635  {% else %} 
    3736  <p class="quiet">(None)</p> 
    3837  {% endif %} 
     38  </div> 
    3939{% endfor %} 
    4040 
  • django/branches/boulder-oracle-sprint/django/contrib/redirects/middleware.py

    r4279 r5509  
    2020                pass 
    2121        if r is not None: 
    22             if r == '': 
     22            if r.new_path == '': 
    2323                return http.HttpResponseGone() 
    2424            return http.HttpResponsePermanentRedirect(r.new_path) 
  • django/branches/boulder-oracle-sprint/django/core/servers/basehttp.py

    r5491 r5509  
    1010from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer 
    1111from types import ListType, StringType 
    12 import os, re, sys, time, urllib 
     12import os, re, sys, time, urllib, mimetypes 
    1313 
    1414__version__ = "0.1" 
     
    630630                status = '200 OK' 
    631631                headers = {} 
     632                mime_type = mimetypes.guess_type(file_path)[0] 
     633                if mime_type: 
     634                    headers['Content-Type'] = mime_type 
    632635                output = [fp.read()] 
    633636                fp.close() 
  • django/branches/boulder-oracle-sprint/docs/install.txt

    r5384 r5509  
    1818============================= 
    1919 
    20 If you just want to experiment with Django, skip this step. Django comes with 
    21 its own Web server for development purposes. 
     20If you just want to experiment with Django, skip ahead to the next 
     21section; Django includes a lightweight web server you can use for 
     22testing, so you won't need to set up Apache until you're ready to 
     23deploy Django in production. 
    2224 
    2325If you want to use Django on a production site, use Apache with `mod_python`_. 
     
    8789``site-packages``. 
    8890 
    89 If you installed Django from a Python Egg, remove the Django ``.egg`` file, 
     91If you installed Django from a Python egg, remove the Django ``.egg`` file, 
    9092and remove the reference to the egg in the file named ``easy-install.pth``. 
    9193This file should also be located in your ``site-packages`` directory. 
     
    9496 
    9597    The location of the ``site-packages`` directory depends on the operating 
    96     system, and the location in which Python was installed. However, the 
    97     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:
    98100 
    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()" 
    100102 
    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.) 
    106105 
    107106Install the Django code 
     
    1421411. Make sure you have Subversion_ installed. 
    1431422. Check out the Django code into your Python ``site-packages`` directory. 
     143 
    144144   On Linux / Mac OSX / Unix, do this:: 
    145145 
    146146       svn co http://code.djangoproject.com/svn/django/trunk/ django_src 
    147        ln -s `pwd`/django_src/django /usr/lib/python2.3/site-packages/django 
     147       ln -s `pwd`/django_src/django SITE-PACKAGES-DIR/django 
    148148 
    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.) 
    150152 
    151153   On Windows, do this:: 
  • django/branches/boulder-oracle-sprint/docs/model-api.txt

    r5463 r5509  
    18941894 
    18951895A final note: If all you want to do is a custom ``WHERE`` clause, you can just 
    1896 just the ``where``, ``tables`` and ``params`` arguments to the standard lookup 
     1896use the ``where``, ``tables`` and ``params`` arguments to the standard lookup 
    18971897API. See `Other lookup options`_. 
    18981898 
    18991899.. _Python DB-API: http://www.python.org/peps/pep-0249.html 
    1900 .. _Other lookup options: ../db-api/#extra-params-select-where-tables 
     1900.. _Other lookup options: ../db-api/#extra-select-none-where-none-params-none-tables-none 
    19011901.. _transaction handling: ../transactions/ 
    19021902 
  • django/branches/boulder-oracle-sprint/docs/newforms.txt

    r5491 r5509  
    111111--------------------------- 
    112112 
    113 A ``Form`` instance is either **bound** or **unbound** to a set of data
     113A ``Form`` instance is either **bound** to a set of data, or **unbound**
    114114 
    115115    * 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  
    1111 
    1212    * 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
    1414 
    1515We'll assume you have `Django installed`_ already. You can tell Django is