Django

Code

Changeset 4503

Show
Ignore:
Timestamp:
02/13/07 10:15:10 (2 years ago)
Author:
adrian
Message:

newforms-admin: Merged to [4502]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/AUTHORS

    r4274 r4503  
    11Django was originally created in late 2003 at World Online, the Web division 
    22of the Lawrence Journal-World newspaper in Lawrence, Kansas. 
    3  
    43 
    54The PRIMARY AUTHORS are (and/or have been): 
     
    4645    akaihola 
    4746    Andreas 
     47    andy@jadedplanet.net 
    4848    ant9000@netwise.it 
    4949    David Ascher <http://ascher.ca/> 
     
    5454    Esdras Beleza <linux@esdrasbeleza.com> 
    5555    James Bennett 
     56    Ben <afternoon@uk2.net> 
    5657    Paul Bissex <http://e-scribe.com/> 
    5758    Simon Blanchard 
    5859    Andrew Brehaut <http://brehaut.net/blog> 
    59     andy@jadedplanet.net 
     60    brut.alll@gmail.com 
     61    Jonathan Buchanan <jonathan.buchanan@gmail.com> 
    6062    Antonio Cavedoni <http://cavedoni.com/> 
    6163    C8E 
     
    6769    Matt Croydon <http://www.postneo.com/> 
    6870    dackze+django@gmail.com 
     71    Dirk Datzert <dummy@habmalnefrage.de> 
    6972    Jonathan Daugherty (cygnus) <http://www.cprogrammer.org/> 
     73    dave@thebarproject.com 
    7074    Jason Davies (Esaj) <http://www.jasondavies.com/> 
    7175    Alex Dedul 
     
    7377    dne@mayonnaise.net 
    7478    Maximillian Dornseif <md@hudora.de> 
    75     dummy@habmalnefrage.de 
    7679    Jeremy Dunck <http://dunck.us/> 
    7780    Andy Dustman <farcepest@gmail.com> 
    7881    Clint Ecker 
    7982    Enrico <rico.bl@gmail.com> 
     83    Marc Fargas <telenieko@telenieko.com> 
    8084    favo@exoweb.net 
    8185    Eric Floehr <eric@intellovations.com> 
     
    8589    Simon Greenhill <dev@simon.net.nz> 
    8690    Espen Grindhaug <http://grindhaug.org/> 
     91    Brian Harring <ferringb@gmail.com> 
    8792    Brant Harris 
    8893    Hawkeye 
    89     heckj@mac.com 
     94    Joe Heck <http://www.rhonabwy.com/wp/> 
    9095    Joel Heenan <joelh-django@planetjoel.com> 
    9196    hipertracker@gmail.com 
     
    9499    Robert Rock Howard <http://djangomojo.com/> 
    95100    Jason Huggins <http://www.jrandolph.com/blog/> 
    96         Baurzhan Ismagulov <ibr@radix50.net> 
     101    Tom Insam 
     102    Baurzhan Ismagulov <ibr@radix50.net> 
    97103    jcrasta@gmail.com 
    98104    Michael Josephson <http://www.sdjournal.com/> 
     
    113119    Christopher Lenz <http://www.cmlenz.net/> 
    114120    lerouxb@gmail.com 
     121    Waylan Limberg <waylan@gmail.com> 
    115122    limodou 
    116123    mattmcc 
     
    163170    Tyson Tate <tyson@fallingbullets.com> 
    164171    Tom Tobin 
    165     Tom Insam 
    166172    Joe Topjian <http://joe.terrarum.net/geek/code/python/django/> 
     173    torne-django@wolfpuppy.org.uk 
    167174    Karen Tracey <graybark@bellsouth.net> 
    168175    Makoto Tsuyuki <mtsuyuki@gmail.com> 
  • django/branches/newforms-admin/django/conf/__init__.py

    r3951 r4503  
    88 
    99import os 
     10import time     # Needed for Windows 
    1011from django.conf import global_settings 
    1112 
     
    106107        self.INSTALLED_APPS = new_installed_apps 
    107108 
    108         # move the time zone info into os.environ 
    109         os.environ['TZ'] = self.TIME_ZONE 
     109        if hasattr(time, 'tzset'): 
     110            # Move the time zone info into os.environ. See ticket #2315 for why 
     111            # we don't do this unconditionally (breaks Windows). 
     112            os.environ['TZ'] = self.TIME_ZONE 
    110113 
    111114    def get_all_members(self): 
  • django/branches/newforms-admin/django/conf/project_template/settings.py

    r4265 r4503  
    1919# Local time zone for this installation. All choices can be found here: 
    2020# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE 
     21# If running in a Windows environment this must be set to the same as your 
     22# system time zone. 
    2123TIME_ZONE = 'America/Chicago' 
    2224 
  • django/branches/newforms-admin/django/contrib/auth/forms.py

    r4266 r4503  
    55from django.core import validators 
    66from django import oldforms 
     7from django.utils.translation import gettext as _ 
    78 
    89class UserCreationForm(oldforms.Manipulator): 
  • django/branches/newforms-admin/django/contrib/syndication/feeds.py

    r4265 r4503  
    7979            author_email = self.__get_dynamic_attr('author_email', obj), 
    8080            categories = self.__get_dynamic_attr('categories', obj), 
     81            feed_copyright = self.__get_dynamic_attr('feed_copyright', obj), 
    8182        ) 
    8283 
     
    117118                author_link = author_link, 
    118119                categories = self.__get_dynamic_attr('item_categories', item), 
     120                item_copyright = self.__get_dynamic_attr('item_copyright', item), 
    119121            ) 
    120122        return feed 
  • django/branches/newforms-admin/django/db/models/__init__.py

    r4343 r4503  
    5151 
    5252    def __getattr__(self, attr): 
     53        if attr == 'delta': 
     54            # To fix ticket #3377. Note that normal accesses to LazyDate.delta 
     55            # (after construction) will still work, because they don't go 
     56            # through __getattr__). This is mainly needed for unpickling. 
     57            raise AttributeError 
    5358        return getattr(self.__get_value__(), attr) 
  • django/branches/newforms-admin/django/db/models/query.py

    r4432 r4503  
    168168    def iterator(self): 
    169169        "Performs the SELECT database lookup of this QuerySet." 
    170         # self._select is a dictionary, and dictionaries' key order is 
    171         # undefined, so we convert it to a list of tuples. 
    172         extra_select = self._select.items() 
    173  
    174         cursor = connection.cursor() 
    175          
    176170        try: 
    177171            select, sql, params = self._get_sql_clause() 
    178172        except EmptyResultSet: 
    179173            raise StopIteration 
    180              
     174 
     175        # self._select is a dictionary, and dictionaries' key order is 
     176        # undefined, so we convert it to a list of tuples. 
     177        extra_select = self._select.items() 
     178 
     179        cursor = connection.cursor() 
    181180        cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + ",".join(select) + sql, params) 
    182181        fill_cache = self._select_related 
     
    199198        counter = self._clone() 
    200199        counter._order_by = () 
     200        counter._select_related = False 
     201         
     202        offset = counter._offset 
     203        limit = counter._limit 
    201204        counter._offset = None 
    202205        counter._limit = None 
    203         counter._select_related = False 
    204206         
    205207        try: 
     
    215217        else: 
    216218            cursor.execute("SELECT COUNT(*)" + sql, params) 
    217         return cursor.fetchone()[0] 
     219        count = cursor.fetchone()[0] 
     220 
     221        # Apply any offset and limit constraints manually, since using LIMIT or 
     222        # OFFSET in SQL doesn't change the output of COUNT. 
     223        if offset: 
     224            count = max(0, count - offset) 
     225        if limit: 
     226            count = min(limit, count) 
     227 
     228        return count 
    218229 
    219230    def get(self, *args, **kwargs): 
     
    524535 
    525536class ValuesQuerySet(QuerySet): 
    526     def iterator(self): 
     537    def __init__(self, *args, **kwargs): 
     538        super(ValuesQuerySet, self).__init__(*args, **kwargs) 
    527539        # select_related and select aren't supported in values(). 
    528540        self._select_related = False 
    529541        self._select = {} 
     542 
     543    def iterator(self): 
     544        try: 
     545            select, sql, params = self._get_sql_clause() 
     546        except EmptyResultSet: 
     547            raise StopIteration 
    530548 
    531549        # self._fields is a list of field names to fetch. 
     
    536554            columns = [f.column for f in self.model._meta.fields] 
    537555            field_names = [f.attname for f in self.model._meta.fields] 
    538  
    539         cursor = connection.cursor() 
    540          
    541         try: 
    542             select, sql, params = self._get_sql_clause() 
    543         except EmptyResultSet: 
    544             raise StopIteration 
    545556         
    546557        select = ['%s.%s' % (backend.quote_name(self.model._meta.db_table), backend.quote_name(c)) for c in columns] 
     558        cursor = connection.cursor() 
    547559        cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + ",".join(select) + sql, params) 
    548560        while 1: 
     
    593605        self._result_cache = [] 
    594606         
    595     def iterator(self): 
    596         raise StopIteration 
    597          
    598607    def count(self): 
    599608        return 0 
     
    606615        c._result_cache = [] 
    607616        return c 
     617 
     618    def _get_sql_clause(self): 
     619        raise EmptyResultSet 
    608620 
    609621class QOperator(object): 
     
    882894                new_column = new_opts.pk.column 
    883895                join_column = field.column 
    884  
    885             raise FieldFound 
     896                raise FieldFound 
     897            elif path: 
     898                # For regular fields, if there are still items on the path, 
     899                # an error has been made. We munge "name" so that the error 
     900                # properly identifies the cause of the problem. 
     901                name += LOOKUP_SEPARATOR + path[0] 
     902            else: 
     903                raise FieldFound 
    886904 
    887905    except FieldFound: # Match found, loop has been shortcut. 
  • django/branches/newforms-admin/django/db/models/related.py

    r4265 r4503  
    6969                return [attr] 
    7070        else: 
    71             return [None] * self.field.rel.num_in_admin 
     71            if self.field.rel.min_num_in_admin: 
     72                return [None] * max(self.field.rel.num_in_admin, self.field.rel.min_num_in_admin) 
     73            else: 
     74                return [None] * self.field.rel.num_in_admin 
    7275 
    7376    def get_db_prep_lookup(self, lookup_type, value): 
  • django/branches/newforms-admin/django/http/__init__.py

    r4135 r4503  
    161161        if not mimetype: 
    162162            mimetype = "%s; charset=%s" % (settings.DEFAULT_CONTENT_TYPE, settings.DEFAULT_CHARSET) 
    163         if hasattr(content, '__iter__'): 
     163        if not isinstance(content, basestring) and hasattr(content, '__iter__'): 
    164164            self._container = content 
    165165            self._is_string = False 
  • django/branches/newforms-admin/django/newforms/fields.py

    r4441 r4503  
    357357        valid_values = set([str(k) for k, v in self.choices]) 
    358358        if value not in valid_values: 
    359             raise ValidationError(gettext(u'Select a valid choice. %s is not one of the available choices.') % value
     359            raise ValidationError(gettext(u'Select a valid choice. That choice is not one of the available choices.')
    360360        return value 
    361361 
  • django/branches/newforms-admin/django/template/context.py

    r4265 r4503  
    5050        return False 
    5151 
     52    def __contains__(self, key): 
     53        return self.has_key(key) 
     54 
    5255    def get(self, key, otherwise=None): 
    5356        for d in self.dicts: 
  • django/branches/newforms-admin/django/template/defaultfilters.py

    r4274 r4503  
    120120    return truncate_words(value, length) 
    121121 
     122def truncatewords_html(value, arg): 
     123    """ 
     124    Truncates HTML after a certain number of words 
     125 
     126    Argument: Number of words to truncate after 
     127    """ 
     128    from django.utils.text import truncate_html_words 
     129    try: 
     130        length = int(arg) 
     131    except ValueError: # invalid literal for int() 
     132        return value # Fail silently. 
     133    if not isinstance(value, basestring): 
     134        value = str(value) 
     135    return truncate_html_words(value, length) 
     136 
    122137def upper(value): 
    123138    "Converts a string into all uppercase" 
     
    127142    "Escapes a value for use in a URL" 
    128143    import urllib 
     144    if not isinstance(value, basestring): 
     145        value = str(value) 
    129146    return urllib.quote(value) 
    130147 
     
    535552register.filter(title) 
    536553register.filter(truncatewords) 
     554register.filter(truncatewords_html) 
    537555register.filter(unordered_list) 
    538556register.filter(upper) 
  • django/branches/newforms-admin/django/template/defaulttags.py

    r4052 r4503  
    316316        return self.mapping.get(self.tagtype, '') 
    317317 
     318class URLNode(Node): 
     319    def __init__(self, view_name, args, kwargs): 
     320        self.view_name = view_name 
     321        self.args = args 
     322        self.kwargs = kwargs 
     323       
     324    def render(self, context): 
     325        from django.core.urlresolvers import reverse, NoReverseMatch 
     326        args = [arg.resolve(context) for arg in self.args] 
     327        kwargs = dict([(k, v.resolve(context)) for k, v in self.kwargs.items()]) 
     328        try: 
     329            return reverse(self.view_name, args=args, kwargs=kwargs) 
     330        except NoReverseMatch: 
     331            try: 
     332                project_name = settings.SETTINGS_MODULE.split('.')[0] 
     333                return reverse(project_name + '.' + self.view_name, args=args, kwargs=kwargs) 
     334            except NoReverseMatch: 
     335                return '' 
     336 
    318337class WidthRatioNode(Node): 
    319338    def __init__(self, val_expr, max_expr, max_width): 
     
    869888templatetag = register.tag(templatetag) 
    870889 
     890def url(parser, token): 
     891    """ 
     892    Returns an absolute URL matching given view with its parameters. This is a 
     893    way to define links that aren't tied to a particular url configuration: 
     894     
     895        {% url path.to.some_view arg1,arg2,name1=value1 %} 
     896     
     897    The first argument is a path to a view. It can be an absolute python path 
     898    or just ``app_name.view_name`` without the project name if the view is 
     899    located inside the project.  Other arguments are comma-separated values 
     900    that will be filled in place of positional and keyword arguments in the 
     901    URL. All arguments for the URL should be present. 
     902 
     903    For example if you have a view ``app_name.client`` taking client's id and 
     904    the corresponding line in a urlconf looks like this: 
     905     
     906        ('^client/(\d+)/$', 'app_name.client') 
     907     
     908    and this app's urlconf is included into the project's urlconf under some 
     909    path: 
     910     
     911        ('^clients/', include('project_name.app_name.urls')) 
     912     
     913    then in a template you can create a link for a certain client like this: 
     914     
     915        {% url app_name.client client.id %} 
     916     
     917    The URL will look like ``/clients/client/123/``. 
     918    """ 
     919    bits = token.contents.split(' ', 2) 
     920    if len(bits) < 2: 
     921        raise TemplateSyntaxError, "'%s' takes at least one argument (path to a view)" % bits[0] 
     922    args = [] 
     923    kwargs = {} 
     924    if len(bits) > 2: 
     925        for arg in bits[2].split(','): 
     926            if '=' in arg: 
     927                k, v = arg.split('=', 1) 
     928                kwargs[k] = parser.compile_filter(v) 
     929            else: 
     930                args.append(parser.compile_filter(arg)) 
     931    return URLNode(bits[1], args, kwargs) 
     932url = register.tag(url) 
     933 
    871934#@register.tag 
    872935def widthratio(parser, token): 
  • django/branches/newforms-admin/django/template/__init__.py

    r4161 r4503  
    118118 
    119119class VariableDoesNotExist(Exception): 
    120     pass 
    121  
     120 
     121    def __init__(self, msg, params=()): 
     122        self.msg = msg 
     123        self.params = params 
     124     
     125    def __str__(self): 
     126        return self.msg % self.params 
     127     
    122128class InvalidTemplateLibrary(Exception): 
    123129    pass 
     
    661667                        current = current[int(bits[0])] 
    662668                    except (IndexError, ValueError, KeyError): 
    663                         raise VariableDoesNotExist, "Failed lookup for key [%s] in %r" % (bits[0], current) # missing attribute 
     669                        raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bits[0], current)) # missing attribute 
    664670                except Exception, e: 
    665671                    if getattr(e, 'silent_variable_failure', False): 
  • django/branches/newforms-admin/django/template/loader_tags.py

    r4265 r4503  
    130130    except AttributeError: # parser.__loaded_blocks isn't a list yet 
    131131        parser.__loaded_blocks = [block_name] 
    132     nodelist = parser.parse(('endblock',)) 
     132    nodelist = parser.parse(('endblock', 'endblock %s' % block_name)) 
    133133    parser.delete_first_token() 
    134134    return BlockNode(block_name, nodelist) 
  • django/branches/newforms-admin/django/test/client.py

    r4265 r4503  
     1import sys 
    12from cStringIO import StringIO 
     3from django.conf import settings 
    24from django.core.handlers.base import BaseHandler 
    35from django.core.handlers.wsgi import WSGIRequest 
     6from django.core.signals import got_request_exception 
    47from django.dispatch import dispatcher 
    58from django.http import urlencode, SimpleCookie 
     
    98101        self.handler = ClientHandler() 
    99102        self.defaults = defaults 
    100         self.cookie = SimpleCookie() 
     103        self.cookies = SimpleCookie() 
     104        self.session = {} 
     105        self.exc_info = None 
     106         
     107    def store_exc_info(self, *args, **kwargs): 
     108        """ 
     109        Utility method that can be used to store exceptions when they are 
     110        generated by a view. 
     111        """ 
     112        self.exc_info = sys.exc_info() 
    101113 
    102114    def request(self, **request): 
     
    109121 
    110122        environ = { 
    111             'HTTP_COOKIE':      self.cookie
     123            'HTTP_COOKIE':      self.cookies
    112124            'PATH_INFO':         '/', 
    113125            'QUERY_STRING':      '', 
     
    126138        on_template_render = curry(store_rendered_templates, data) 
    127139        dispatcher.connect(on_template_render, signal=signals.template_rendered) 
     140 
     141        # Capture exceptions created by the handler 
     142        dispatcher.connect(self.store_exc_info, signal=got_request_exception) 
    128143 
    129144        response = self.handler(environ) 
     
    141156                setattr(response, detail, None) 
    142157 
     158        # Look for a signalled exception and reraise it 
     159        if self.exc_info: 
     160            raise self.exc_info[1], None, self.exc_info[2] 
     161         
     162        # Update persistent cookie and session data 
    143163        if response.cookies: 
    144             self.cookie.update(response.cookies) 
    145  
     164            self.cookies.update(response.cookies) 
     165 
     166        if 'django.contrib.sessions' in settings.INSTALLED_APPS: 
     167            from django.contrib.sessions.middleware import SessionWrapper 
     168            cookie = self.cookies.get(settings.SESSION_COOKIE_NAME, None) 
     169            if cookie: 
     170                self.session = SessionWrapper(cookie.value) 
     171             
    146172        return response 
    147173 
  • django/branches/newforms-admin/django/utils/feedgenerator.py

    r4265 r4503  
    4141    def __init__(self, title, link, description, language=None, author_email=None, 
    4242            author_name=None, author_link=None, subtitle=None, categories=None, 
    43             feed_url=None): 
     43            feed_url=None, feed_copyright=None): 
    4444        self.feed = { 
    4545            'title': title, 
     
    5353            'categories': categories or (), 
    5454            'feed_url': feed_url, 
     55            'feed_copyright': feed_copyright, 
    5556        } 
    5657        self.items = [] 
     
    5859    def add_item(self, title, link, description, author_email=None, 
    5960        author_name=None, author_link=None, pubdate=None, comments=None, 
    60         unique_id=None, enclosure=None, categories=()): 
     61        unique_id=None, enclosure=None, categories=(), item_copyright=None): 
    6162        """ 
    6263        Adds an item to the feed. All args are expected to be Python Unicode 
     
    7677            'enclosure': enclosure, 
    7778            'categories': categories or (), 
     79            'item_copyright': item_copyright, 
    7880        }) 
    7981 
     
    129131        for cat in self.feed['categories']: 
    130132            handler.addQuickElement(u"category", cat) 
     133        if self.feed['feed_copyright'] is not None: 
     134            handler.addQuickElement(u"copyright", self.feed['feed_copyright']) 
    131135        self.write_items(handler) 
    132136        self.endChannelElement(handler) 
     
    213217        for cat in self.feed['categories']: 
    214218            handler.addQuickElement(u"category", "", {u"term": cat}) 
     219        if self.feed['feed_copyright'] is not None: 
     220            handler.addQuickElement(u"rights", self.feed['feed_copyright']) 
    215221        self.write_items(handler) 
    216222        handler.endElement(u"feed") 
     
    253259                     u"type": item['enclosure'].mime_type}) 
    254260 
    255             # Categories: 
     261            # Categories. 
    256262            for cat in item['categories']: 
    257263                handler.addQuickElement(u"category", u"", {u"term": cat}) 
     264 
     265            # Rights. 
     266            if item['item_copyright'] is not None: 
     267                handler.addQuickElement(u"rights", item['item_copyright']) 
    258268 
    259269            handler.endElement(u"entry") 
  • django/branches/newforms-admin/django/utils/text.py

    r4213 r4503  
    4242    return ' '.join(words) 
    4343 
     44def truncate_html_words(s, num): 
     45    """ 
     46    Truncates html to a certain number of words (not counting tags and comments). 
     47    Closes opened tags if they were correctly closed in the given html. 
     48    """ 
     49    length = int(num) 
     50    if length <= 0: 
     51        return '' 
     52    html4_singlets = ('br', 'col', 'link', 'base', 'img', 'param', 'area', 'hr', 'input') 
     53    # Set up regular expressions 
     54    re_words = re.compile(r'&.*?;|<.*?>|([A-Za-z0-9][\w-]*)') 
     55    re_tag = re.compile(r'<(/)?([^ ]+?)(?: (/)| .*?)?>') 
     56    # Count non-HTML words and keep note of open tags 
     57    pos = 0 
     58    ellipsis_pos = 0 
     59    words = 0 
     60    open_tags = [] 
     61    while words <= length: 
     62        m = re_words.search(s, pos) 
     63        if not m: 
     64            # Checked through whole string 
     65            break 
     66        pos = m.end(0) 
     67        if m.group(1): 
     68            # It's an actual non-HTML word 
     69            words += 1 
     70            if words == length: 
     71                ellipsis_pos = pos 
     72            continue 
     73        # Check for tag 
     74        tag = re_tag.match(m.group(0)) 
     75        if not tag or ellipsis_pos: 
     76            # Don't worry about non tags or tags after our truncate point 
     77            continue 
     78        closing_tag, tagname, self_closing = tag.groups() 
     79        tagname = tagname.lower()  # Element names are always case-insensitive 
     80        if self_closing or tagname in html4_singlets: 
     81            pass 
     82        elif closing_tag: 
     83            # Check for match in open tags list 
     84            try: 
     85                i = open_tags.index(tagname) 
     86            except ValueError: 
     87                pass 
     88            else: 
     89                # SGML: An end tag closes, back to the matching start tag, all unclosed intervening start tags with omitted end tags 
     90                open_tags = open_tags[i+1:] 
     91        else: 
     92            # Add it to the start of the open tags list 
     93            open_tags.insert(0, tagname) 
     94    if words <= length: 
     95        # Don't try to close tags if we don't need to truncate 
     96        return s 
     97    out = s[:ellipsis_pos] + ' ...' 
     98    # Close any tags still open 
     99    for tag in open_tags: 
     100        out += '</%s>' % tag 
     101    # Return string 
     102    return out 
     103 
    44104def get_valid_filename(s): 
    45105    """ 
  • django/branches/newforms-admin/docs/contributing.txt

    r4426 r4503  
    485485change the symlink to point to the old code. 
    486486 
     487A third option is to use a `path file`_ (``<something>.pth``) which should 
     488work on all systems (including Windows, which doesn't have symlinks 
     489available). First, make sure there are no files, directories or symlinks named 
     490``django`` in your ``site-packages`` directory. Then create a text file named 
     491``django.pth`` and save it to your ``site-packages`` directory. That file 
     492should contain a path to your copy of Django on a single line and optional 
     493comments. Here is an example that points to multiple branches. Just uncomment 
     494the line for the branch you want to use ('Trunk' in this example) and make 
     495sure all other lines are commented:: 
     496 
     497    # Trunk is a svn checkout of: 
     498    #   http://code.djangoproject.com/svn/django/trunk/ 
     499    # 
     500    /path/to/trunk 
     501     
     502    # <branch> is a svn checkout of: 
     503    #   http://code.djangoproject.com/svn/django/branches/<branch>/ 
     504    # 
     505    #/path/to/<branch> 
     506     
     507    # On windows a path may look like this: 
     508    # C:/path/to/<branch> 
     509 
    487510If you're using Django 0.95 or earlier and installed it using 
    488511``python setup.py install``, you'll have a directory called something like 
     
    491514file. Then copy the branch's version of the ``django`` directory into 
    492515``site-packages``. 
     516 
     517.. _path file: http://docs.python.org/lib/module-site.html 
    493518 
    494519Official releases 
  • django/branches/newforms-admin/docs/django-admin.txt

    r4426 r4503  
    1818Django via its ``setup.py`` utility. If it's not on your path, you can find it in 
    1919``site-packages/django/bin`` within your Python installation. Consider 
    20 symlinking to it from some place on your path, such as ``/usr/local/bin``. 
     20symlinking it from some place on your path, such as ``/usr/local/bin``. 
     21 
     22For Windows users, who do not have symlinking functionality available, you 
     23can copy ``django-admin.py`` to a location on your existing path or edit the 
     24``PATH`` settings (under ``Settings - Control Panel - System - Advanced - Environment...``) 
     25to point to its installed location. 
    2126 
    2227Generally, when working on a single Django project, it's easier to use 
  • django/branches/newforms-admin/docs/fastcgi.txt

    r4426 r4503  
    275275Then, create a small script that tells Apache how to spawn your FastCGI 
    276276program. Create a file ``mysite.fcgi`` and place it in your Web directory, and 
    277 be sure to make it executable :: 
     277be sure to make it executable:: 
    278278 
    279279    #!/usr/bin/python 
  • django/branches/newforms-admin/docs/forms.txt

    r4426 r4503  
    174174        # Check for validation errors 
    175175        errors = manipulator.get_validation_errors(new_data) 
     176        manipulator.do_html2python(new_data) 
    176177        if errors: 
    177178            return render_to_response('places/errors.html', {'errors': errors}) 
    178179        else: 
    179             manipulator.do_html2python(new_data) 
    180180            new_place = manipulator.save(new_data) 
    181181            return HttpResponse("Place created: %s" % new_place) 
     
    230230            # Check for errors. 
    231231            errors = manipulator.get_validation_errors(new_data) 
     232            manipulator.do_html2python(new_data) 
    232233 
    233234            if not errors: 
    234235                # No errors. This means we can save the data! 
    235                 manipulator.do_html2python(new_data) 
    236236                new_place = manipulator.save(new_data) 
    237237 
     
    325325            new_data = request.POST.copy() 
    326326            errors = manipulator.get_validation_errors(new_data) 
     327            manipulator.do_html2python(new_data) 
    327328            if not errors: 
    328                 manipulator.do_html2python(new_data) 
    329329                manipulator.save(new_data) 
    330330 
     
    407407            new_data = request.POST.copy() 
    408408            errors = manipulator.get_validation_errors(new_data) 
     409            manipulator.do_html2python(new_data) 
    409410            if not errors: 
    410                 manipulator.do_html2python(new_data) 
    411411 
    412412                # Send e-mail using new_data here... 
  • django/branches/newforms-admin/docs/outputting_pdf.txt

    r4426 r4503  
    3030If that command doesn't raise any errors, the installation worked. 
    3131&