Changeset 7122
- Timestamp:
- 02/15/08 23:15:09 (7 months ago)
- Files:
-
- django/trunk/django/utils/datastructures.py (modified) (1 diff)
- django/trunk/docs/modelforms.txt (modified) (3 diffs)
- django/trunk/docs/request_response.txt (modified) (1 diff)
- django/trunk/docs/shortcuts.txt (modified) (1 diff)
- django/trunk/docs/templates.txt (modified) (1 diff)
- django/trunk/docs/url_dispatch.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/utils/datastructures.py
r7062 r7122 4 4 up values in more than one dictionary, passed in the constructor. 5 5 6 If a key appears in more than one of the passed in dictionaries, only the6 If a key appears in more than one of the given dictionaries, only the 7 7 first occurrence will be used. 8 8 """ django/trunk/docs/modelforms.txt
r7115 r7122 324 324 Form inheritance 325 325 ---------------- 326 As with the basic forms, you can extend and reuse ``ModelForms`` by inheriting 327 them. Normally, this will be useful if you need to declare some extra fields 328 or extra methods on a parent class for use in a number of forms derived from 329 models. For example, using the previous ``ArticleForm`` class:: 326 327 As with basic forms, you can extend and reuse ``ModelForms`` by inheriting 328 them. This is useful if you need to declare extra fields or extra methods on a 329 parent class for use in a number of forms derived from models. For example, 330 using the previous ``ArticleForm`` class:: 330 331 331 332 >>> class EnhancedArticleForm(ArticleForm): … … 333 334 ... ... 334 335 335 This creates a form that behaves identically to ``ArticleForm``, except there 336 issome extra validation and cleaning for the ``pub_date`` field.336 This creates a form that behaves identically to ``ArticleForm``, except there's 337 some extra validation and cleaning for the ``pub_date`` field. 337 338 338 339 You can also subclass the parent's ``Meta`` inner class if you want to change … … 343 344 ... exclude = ['body'] 344 345 345 This adds inthe extra method from the ``EnhancedArticleForm`` and modifies346 This adds the extra method from the ``EnhancedArticleForm`` and modifies 346 347 the original ``ArticleForm.Meta`` to remove one field. 347 348 348 There are a couple of things to note, however. Most of these won't normally be 349 of concern unless you are trying to do something tricky with subclassing. 349 There are a couple of things to note, however. 350 350 351 351 * Normal Python name resolution rules apply. If you have multiple base 352 352 classes that declare a ``Meta`` inner class, only the first one will be 353 used. This means the child's ``Meta``, if it exists, otherwise the353 used. This means the child's ``Meta``, if it exists, otherwise the 354 354 ``Meta`` of the first parent, etc. 355 355 356 * For technical reasons, you cannot have a subclass that is inherited from 357 both a ``ModelForm`` and a ``Form`` simultaneously. 358 356 * For technical reasons, a subclass cannot inherit from both a ``ModelForm`` 357 and a ``Form`` simultaneously. 358 359 Chances are these notes won't affect you unless you're trying to do something 360 tricky with subclassing. django/trunk/docs/request_response.txt
r7081 r7122 577 577 578 578 * The 404 view is passed a ``RequestContext`` and will have access to 579 variables supplied by your ``TEMPLATE_CONTEXT_PROCESSORS`` (e.g.579 variables supplied by your ``TEMPLATE_CONTEXT_PROCESSORS`` setting (e.g., 580 580 ``MEDIA_URL``). 581 581 django/trunk/docs/shortcuts.txt
r7053 r7122 31 31 The context instance to render the template with. By default, the template 32 32 will be rendered with a ``Context`` instance (filled with values from 33 ``dictionary``). If you need to use `context processors`_, you will want to34 render the template with a ``RequestContext`` instance instead. Your code35 might looksomething like this::33 ``dictionary``). If you need to use `context processors`_, render the 34 template with a ``RequestContext`` instance instead. Your code might look 35 something like this:: 36 36 37 37 return render_to_response('my_template.html', django/trunk/docs/templates.txt
r7007 r7122 1407 1407 ~~~~ 1408 1408 1409 **New in Django development version.** 1410 1409 1411 Returns the last item in a list. 1410 1412 django/trunk/docs/url_dispatch.txt
r7110 r7122 192 192 193 193 .. note:: 194 Since `patterns()` is a function call, it accepts a maximum of 255194 Because `patterns()` is a function call, it accepts a maximum of 255 195 195 arguments (URL patterns, in this case). This is a limit for all Python 196 function calls. This will rarely be problem in practice, since you'll196 function calls. This is rarely a problem in practice, because you'll 197 197 typically structure your URL patterns modularly by using `include()` 198 198 sections. However, on the off-chance you do hit the 255-argument limit, 199 reali se that `patterns()` returns a Python list, so you can split up the199 realize that `patterns()` returns a Python list, so you can split up the 200 200 construction of the list. 201 201 … … 210 210 211 211 Python lists have unlimited size, so there's no limit to how many URL 212 patterns you can construct ; merely that you may only create 254 at a time213 (the 255-th argument is the initial prefix argument).212 patterns you can construct. The only limit is that you can only create 254 213 at a time (the 255th argument is the initial prefix argument). 214 214 215 215 url
