Ticket #15233: adjusted-module-directives.patch
File adjusted-module-directives.patch, 28.9 KB (added by , 14 years ago) |
---|
-
docs/howto/custom-model-fields.txt
308 308 Custom database types 309 309 ~~~~~~~~~~~~~~~~~~~~~ 310 310 311 .. method:: db_type(self, connection)311 .. method:: Field.db_type(self, connection) 312 312 313 313 .. versionadded:: 1.2 314 314 The ``connection`` argument was added to support multiple databases. … … 398 398 Converting database values to Python objects 399 399 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 400 400 401 .. method:: to_python(self, value)401 .. method:: Field.to_python(self, value) 402 402 403 403 Converts a value as returned by your database (or a serializer) to a Python 404 404 object. … … 447 447 Converting Python objects to query values 448 448 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 449 449 450 .. method:: get_prep_value(self, value)450 .. method:: Field.get_prep_value(self, value) 451 451 452 452 .. versionadded:: 1.2 453 453 This method was factored out of ``get_db_prep_value()`` … … 475 475 Converting query values to database values 476 476 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 477 477 478 .. method:: get_db_prep_value(self, value, connection, prepared=False)478 .. method:: Field.get_db_prep_value(self, value, connection, prepared=False) 479 479 480 480 .. versionadded:: 1.2 481 481 The ``connection`` and ``prepared`` arguments were added to support multiple databases. … … 494 494 initial data conversions before performing any database-specific 495 495 processing. 496 496 497 .. method:: get_db_prep_save(self, value, connection)497 .. method:: Field.get_db_prep_save(self, value, connection) 498 498 499 499 .. versionadded:: 1.2 500 500 The ``connection`` argument was added to support multiple databases. … … 509 509 Preprocessing values before saving 510 510 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 511 511 512 .. method:: pre_save(self, model_instance, add)512 .. method:: Field.pre_save(self, model_instance, add) 513 513 514 514 This method is called just prior to :meth:`get_db_prep_save` and should return 515 515 the value of the appropriate attribute from ``model_instance`` for this field. … … 535 535 As with value conversions, preparing a value for database lookups is a 536 536 two phase process. 537 537 538 .. method:: get_prep_lookup(self, lookup_type, value)538 .. method:: Field.get_prep_lookup(self, lookup_type, value) 539 539 540 540 .. versionadded:: 1.2 541 541 This method was factored out of ``get_db_prep_lookup()`` … … 586 586 else: 587 587 raise TypeError('Lookup type %r not supported.' % lookup_type) 588 588 589 .. method:: get_db_prep_lookup(self, lookup_type, value, connection, prepared=False)589 .. method:: Field.get_db_prep_lookup(self, lookup_type, value, connection, prepared=False) 590 590 591 591 .. versionadded:: 1.2 592 592 The ``connection`` and ``prepared`` arguments were added to support multiple databases. … … 600 600 Specifying the form field for a model field 601 601 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 602 602 603 .. method:: formfield(self, form_class=forms.CharField, **kwargs)603 .. method:: Field.formfield(self, form_class=forms.CharField, **kwargs) 604 604 605 605 Returns the default form field to use when this field is displayed in a model. 606 606 This method is called by the :class:`~django.forms.ModelForm` helper. … … 635 635 Emulating built-in field types 636 636 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 637 637 638 .. method:: get_internal_type(self)638 .. method:: Field.get_internal_type(self) 639 639 640 640 Returns a string giving the name of the :class:`~django.db.models.Field` 641 641 subclass we are emulating at the database level. This is used to determine the … … 669 669 Converting field data for serialization 670 670 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 671 671 672 .. method:: value_to_string(self, obj)672 .. method:: Field.value_to_string(self, obj) 673 673 674 674 This method is used by the serializers to convert the field into a string for 675 675 output. Calling :meth:`Field._get_val_from_obj(obj)` is the best way to get the -
docs/topics/http/file-uploads.txt
2 2 File Uploads 3 3 ============ 4 4 5 .. currentmodule:: django.core.files 5 .. currentmodule:: django.core.files.uploadedfile 6 6 7 7 When Django handles a file upload, the file data ends up placed in 8 8 :attr:`request.FILES <django.http.HttpRequest.FILES>` (for more on the … … 59 59 Handling uploaded files 60 60 ----------------------- 61 61 62 The final piece of the puzzle is handling the actual file data from 63 :attr:`request.FILES <django.http.HttpRequest.FILES>`. Each entry in this 64 dictionary is an ``UploadedFile`` object -- a simple wrapper around an uploaded 65 file. You'll usually use one of these methods to access the uploaded content: 62 .. class:: UploadedFile 66 63 67 ``UploadedFile.read()`` 64 The final piece of the puzzle is handling the actual file data from 65 :attr:`request.FILES <django.http.HttpRequest.FILES>`. Each entry in this 66 dictionary is an ``UploadedFile`` object -- a simple wrapper around an uploaded 67 file. You'll usually use one of these methods to access the uploaded content: 68 69 .. method:: read() 70 68 71 Read the entire uploaded data from the file. Be careful with this 69 72 method: if the uploaded file is huge it can overwhelm your system if you 70 73 try to read it into memory. You'll probably want to use ``chunks()`` 71 74 instead; see below. 72 75 73 ``UploadedFile.multiple_chunks()`` 76 .. method:: multiple_chunks() 77 74 78 Returns ``True`` if the uploaded file is big enough to require 75 79 reading in multiple chunks. By default this will be any file 76 80 larger than 2.5 megabytes, but that's configurable; see below. 77 81 78 ``UploadedFile.chunks()`` 82 .. method:: chunks() 83 79 84 A generator returning chunks of the file. If ``multiple_chunks()`` is 80 85 ``True``, you should use this method in a loop instead of ``read()``. 81 86 82 87 In practice, it's often easiest simply to use ``chunks()`` all the time; 83 88 see the example below. 84 89 85 ``UploadedFile.name`` 90 .. attribute:: name 91 86 92 The name of the uploaded file (e.g. ``my_file.txt``). 87 93 88 ``UploadedFile.size`` 94 .. attribute:: size 95 89 96 The size, in bytes, of the uploaded file. 90 97 91 98 There are a few other methods and attributes available on ``UploadedFile`` … … 177 184 ``UploadedFile`` objects 178 185 ======================== 179 186 180 .. class:: UploadedFile181 182 187 In addition to those inherited from :class:`File`, all ``UploadedFile`` objects 183 188 define the following methods/attributes: 184 189 185 ``UploadedFile.content_type`` 186 The content-type header uploaded with the file (e.g. ``text/plain`` or 187 ``application/pdf``). Like any data supplied by the user, you shouldn't 188 trust that the uploaded file is actually this type. You'll still need to 189 validate that the file contains the content that the content-type header 190 claims -- "trust but verify." 190 .. attribute:: UploadedFile.content_type 191 191 192 ``UploadedFile.charset`` 193 For ``text/*`` content-types, the character set (i.e. ``utf8``) supplied 194 by the browser. Again, "trust but verify" is the best policy here. 192 The content-type header uploaded with the file (e.g. ``text/plain`` or 193 ``application/pdf``). Like any data supplied by the user, you shouldn't 194 trust that the uploaded file is actually this type. You'll still need to 195 validate that the file contains the content that the content-type header 196 claims -- "trust but verify." 195 197 196 ``UploadedFile.temporary_file_path()`` 197 Only files uploaded onto disk will have this method; it returns the full 198 path to the temporary uploaded file. 198 .. attribute:: UploadedFile.charset 199 199 200 For ``text/*`` content-types, the character set (i.e. ``utf8``) supplied 201 by the browser. Again, "trust but verify" is the best policy here. 202 203 .. attribute:: UploadedFile.temporary_file_path() 204 205 Only files uploaded onto disk will have this method; it returns the full 206 path to the temporary uploaded file. 207 200 208 .. note:: 201 209 202 210 Like regular Python files, you can read the file line-by-line simply by -
docs/topics/http/decorators.txt
45 45 headers; see 46 46 :doc:`conditional view processing </topics/conditional-view-processing>`. 47 47 48 .. currentmodule:: django.views.decorators. http48 .. currentmodule:: django.views.decorators.gzip 49 49 50 50 GZip compression 51 51 ================ -
docs/topics/http/urls.txt
765 765 Utility methods 766 766 =============== 767 767 768 .. module:: django.core.urlresolvers 769 768 770 reverse() 769 771 --------- 770 772 -
docs/topics/auth.txt
615 615 Manually checking a user's password 616 616 ----------------------------------- 617 617 618 .. currentmodule:: django.contrib.auth.models 619 618 620 .. function:: check_password() 619 621 620 622 If you'd like to manually authenticate a user by comparing a plain-text … … 627 629 How to log a user out 628 630 --------------------- 629 631 632 .. currentmodule:: django.contrib.auth 633 630 634 .. function:: logout() 631 635 632 636 To log out a user who has been logged in via … … 869 873 Other built-in views 870 874 -------------------- 871 875 876 .. module:: django.contrib.auth.views 877 872 878 In addition to the :func:`~views.login` view, the authentication system 873 879 includes a few other useful built-in views located in 874 880 :mod:`django.contrib.auth.views`: 875 881 876 .. function:: views.logout(request, [next_page, template_name, redirect_field_name])882 .. function:: logout(request, [next_page, template_name, redirect_field_name]) 877 883 878 884 Logs a user out. 879 885 … … 893 899 894 900 * ``title``: The string "Logged out", localized. 895 901 896 .. function:: views.logout_then_login(request[, login_url])902 .. function:: logout_then_login(request[, login_url]) 897 903 898 904 Logs a user out, then redirects to the login page. 899 905 … … 902 908 * ``login_url``: The URL of the login page to redirect to. This will 903 909 default to :setting:`settings.LOGIN_URL <LOGIN_URL>` if not supplied. 904 910 905 .. function:: views.password_change(request[, template_name, post_change_redirect, password_change_form])911 .. function:: password_change(request[, template_name, post_change_redirect, password_change_form]) 906 912 907 913 Allows a user to change their password. 908 914 … … 926 932 927 933 * ``form``: The password change form. 928 934 929 .. function:: views.password_change_done(request[, template_name])935 .. function:: password_change_done(request[, template_name]) 930 936 931 937 The page shown after a user has changed their password. 932 938 … … 936 942 default to :file:`registration/password_change_done.html` if not 937 943 supplied. 938 944 939 .. function:: views.password_reset(request[, is_admin_site, template_name, email_template_name, password_reset_form, token_generator, post_reset_redirect, from_email])945 .. function:: password_reset(request[, is_admin_site, template_name, email_template_name, password_reset_form, token_generator, post_reset_redirect, from_email]) 940 946 941 947 Allows a user to reset their password by generating a one-time use link 942 948 that can be used to reset the password, and sending that link to the … … 971 977 972 978 * ``form``: The form for resetting the user's password. 973 979 974 .. function:: views.password_reset_done(request[, template_name])980 .. function:: password_reset_done(request[, template_name]) 975 981 976 982 The page shown after a user has reset their password. 977 983 … … 981 987 default to :file:`registration/password_reset_done.html` if not 982 988 supplied. 983 989 984 .. function:: views.redirect_to_login(next[, login_url, redirect_field_name])990 .. function:: redirect_to_login(next[, login_url, redirect_field_name]) 985 991 986 992 Redirects to the login page, and then back to another URL after a 987 993 successful login. … … 999 1005 URL to redirect to after log out. Overrides ``next`` if the given 1000 1006 ``GET`` parameter is passed. 1001 1007 1008 1002 1009 .. function:: password_reset_confirm(request[, uidb36, token, template_name, token_generator, set_password_form, post_reset_redirect]) 1003 1010 1004 1011 Presents a form for entering a new password. -
docs/ref/models/querysets.txt
2 2 QuerySet API reference 3 3 ====================== 4 4 5 .. currentmodule:: django.db.models. QuerySet5 .. currentmodule:: django.db.models.query 6 6 7 7 This document describes the details of the ``QuerySet`` API. It builds on the 8 8 material presented in the :doc:`model </topics/db/models>` and :doc:`database … … 137 137 filter 138 138 ~~~~~~ 139 139 140 .. method:: filter(**kwargs)140 .. method:: QuerySet.filter(**kwargs) 141 141 142 142 Returns a new ``QuerySet`` containing objects that match the given lookup 143 143 parameters. … … 149 149 exclude 150 150 ~~~~~~~ 151 151 152 .. method:: exclude(**kwargs)152 .. method:: QuerySet.exclude(**kwargs) 153 153 154 154 Returns a new ``QuerySet`` containing objects that do *not* match the given 155 155 lookup parameters. … … 184 184 annotate 185 185 ~~~~~~~~ 186 186 187 .. method:: annotate(*args, **kwargs)187 .. method:: QuerySet.annotate(*args, **kwargs) 188 188 189 189 Annotates each object in the ``QuerySet`` with the provided list of 190 190 aggregate values (averages, sums, etc) that have been computed over … … 226 226 order_by 227 227 ~~~~~~~~ 228 228 229 .. method:: order_by(*fields)229 .. method:: QuerySet.order_by(*fields) 230 230 231 231 By default, results returned by a ``QuerySet`` are ordered by the ordering 232 232 tuple given by the ``ordering`` option in the model's ``Meta``. You can … … 291 291 reverse 292 292 ~~~~~~~ 293 293 294 .. method:: reverse()294 .. method:: QuerySet.reverse() 295 295 296 296 Use the ``reverse()`` method to reverse the order in which a queryset's 297 297 elements are returned. Calling ``reverse()`` a second time restores the … … 319 319 distinct 320 320 ~~~~~~~~ 321 321 322 .. method:: distinct()322 .. method:: QuerySet.distinct() 323 323 324 324 Returns a new ``QuerySet`` that uses ``SELECT DISTINCT`` in its SQL query. This 325 325 eliminates duplicate rows from the query results. … … 352 352 values 353 353 ~~~~~~ 354 354 355 .. method:: values(*fields)355 .. method:: QuerySet.values(*fields) 356 356 357 357 Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that returns dictionaries when 358 358 used as an iterable, rather than model-instance objects. … … 458 458 values_list 459 459 ~~~~~~~~~~~ 460 460 461 .. method:: values_list(*fields)461 .. method:: QuerySet.values_list(*fields) 462 462 463 463 This is similar to ``values()`` except that instead of returning dictionaries, 464 464 it returns tuples when iterated over. Each tuple contains the value from the … … 486 486 dates 487 487 ~~~~~ 488 488 489 .. method:: dates(field, kind, order='ASC')489 .. method:: QuerySet.dates(field, kind, order='ASC') 490 490 491 491 Returns a ``DateQuerySet`` -- a ``QuerySet`` that evaluates to a list of 492 492 ``datetime.datetime`` objects representing all available dates of a particular … … 522 522 none 523 523 ~~~~ 524 524 525 .. method:: none()525 .. method:: QuerySet.none() 526 526 527 527 Returns an ``EmptyQuerySet`` -- a ``QuerySet`` that always evaluates to 528 528 an empty list. This can be used in cases where you know that you should … … 537 537 all 538 538 ~~~ 539 539 540 .. method:: all()540 .. method:: QuerySet.all() 541 541 542 542 Returns a *copy* of the current ``QuerySet`` (or ``QuerySet`` subclass you 543 543 pass in). This can be useful in some situations where you might want to pass … … 550 550 select_related 551 551 ~~~~~~~~~~~~~~ 552 552 553 .. method:: select_related()553 .. method:: QuerySet.select_related() 554 554 555 555 Returns a ``QuerySet`` that will automatically "follow" foreign-key 556 556 relationships, selecting that additional related-object data when it executes … … 666 666 extra 667 667 ~~~~~ 668 668 669 .. method:: extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)669 .. method:: QuerySet.extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None) 670 670 671 671 Sometimes, the Django query syntax by itself can't easily express a complex 672 672 ``WHERE`` clause. For these edge cases, Django provides the ``extra()`` … … 827 827 defer 828 828 ~~~~~ 829 829 830 .. method:: defer(*fields)830 .. method:: QuerySet.defer(*fields) 831 831 832 832 In some complex data-modeling situations, your models might contain a lot of 833 833 fields, some of which could contain a lot of data (for example, text fields), … … 887 887 only 888 888 ~~~~ 889 889 890 .. method:: only(*fields)890 .. method:: QuerySet.only(*fields) 891 891 892 892 The ``only()`` method is more or less the opposite of ``defer()``. You 893 893 call it with the fields that should *not* be deferred when retrieving a model. … … 923 923 using 924 924 ~~~~~ 925 925 926 .. method:: using(alias)926 .. method:: QuerySet.using(alias) 927 927 928 928 .. versionadded:: 1.2 929 929 … … 953 953 get 954 954 ~~~ 955 955 956 .. method:: get(**kwargs)956 .. method:: QuerySet.get(**kwargs) 957 957 958 958 Returns the object matching the given lookup parameters, which should be in 959 959 the format described in `Field lookups`_. … … 982 982 create 983 983 ~~~~~~ 984 984 985 .. method:: create(**kwargs)985 .. method:: QuerySet.create(**kwargs) 986 986 987 987 A convenience method for creating an object and saving it all in one step. Thus:: 988 988 … … 1006 1006 get_or_create 1007 1007 ~~~~~~~~~~~~~ 1008 1008 1009 .. method:: get_or_create(**kwargs)1009 .. method:: QuerySet.get_or_create(**kwargs) 1010 1010 1011 1011 A convenience method for looking up an object with the given kwargs, creating 1012 1012 one if necessary. … … 1076 1076 count 1077 1077 ~~~~~ 1078 1078 1079 .. method:: count()1079 .. method:: QuerySet.count() 1080 1080 1081 1081 Returns an integer representing the number of objects in the database matching 1082 1082 the ``QuerySet``. ``count()`` never raises exceptions. … … 1102 1102 in_bulk 1103 1103 ~~~~~~~ 1104 1104 1105 .. method:: in_bulk(id_list)1105 .. method:: QuerySet.in_bulk(id_list) 1106 1106 1107 1107 Takes a list of primary-key values and returns a dictionary mapping each 1108 1108 primary-key value to an instance of the object with the given ID. … … 1121 1121 iterator 1122 1122 ~~~~~~~~ 1123 1123 1124 .. method:: iterator()1124 .. method:: QuerySet.iterator() 1125 1125 1126 1126 Evaluates the ``QuerySet`` (by performing the query) and returns an 1127 1127 `iterator`_ over the results. A ``QuerySet`` typically caches its … … 1139 1139 latest 1140 1140 ~~~~~~ 1141 1141 1142 .. method:: latest(field_name=None)1142 .. method:: QuerySet.latest(field_name=None) 1143 1143 1144 1144 Returns the latest object in the table, by date, using the ``field_name`` 1145 1145 provided as the date field. … … 1161 1161 aggregate 1162 1162 ~~~~~~~~~ 1163 1163 1164 .. method:: aggregate(*args, **kwargs)1164 .. method:: QuerySet.aggregate(*args, **kwargs) 1165 1165 1166 1166 Returns a dictionary of aggregate values (averages, sums, etc) calculated 1167 1167 over the ``QuerySet``. Each argument to ``aggregate()`` specifies … … 1193 1193 exists 1194 1194 ~~~~~~ 1195 1195 1196 .. method:: exists()1196 .. method:: QuerySet.exists() 1197 1197 1198 1198 .. versionadded:: 1.2 1199 1199 … … 1209 1209 update 1210 1210 ~~~~~~ 1211 1211 1212 .. method:: update(**kwargs)1212 .. method:: QuerySet.update(**kwargs) 1213 1213 1214 1214 Performs an SQL update query for the specified fields, and returns 1215 1215 the number of rows affected. The ``update()`` method is applied instantly and … … 1234 1234 delete 1235 1235 ~~~~~~ 1236 1236 1237 .. method:: delete()1237 .. method:: QuerySet.delete() 1238 1238 1239 1239 Performs an SQL delete query on all rows in the :class:`QuerySet`. The 1240 1240 ``delete()`` is applied instantly. You cannot call ``delete()`` on a … … 1749 1749 Aggregation functions 1750 1750 --------------------- 1751 1751 1752 .. module:: django.db.models.aggregates 1753 1752 1754 Django provides the following aggregation functions in the 1753 1755 ``django.db.models`` module. For details on how to use these 1754 1756 aggregate functions, see -
docs/ref/forms/widgets.txt
160 160 Takes two optional arguments, ``date_format`` and ``time_format``, which 161 161 work just like the ``format`` argument for ``DateInput`` and ``TimeInput``. 162 162 163 .. module:: django.forms.extras.widgets 164 163 165 .. class:: SelectDateWidget 164 166 165 167 Wrapper around three select widgets: one each for month, day, and year. … … 180 182 181 183 Specifying widgets 182 184 ------------------ 185 .. currentmodule:: django.forms 183 186 184 187 .. attribute:: Form.widget 185 188 -
docs/ref/contrib/gis/gdal.txt
97 97 ``Layer`` 98 98 --------- 99 99 100 .. module:: django.contrib.gis.gdal.layer 101 100 102 .. class:: Layer 101 103 102 104 ``Layer`` is a wrapper for a layer of data in a ``DataSource`` object. … … 266 268 ``Feature`` 267 269 ----------- 268 270 271 .. module:: django.contrib.gis.gdal.feature 272 269 273 .. class:: Feature 270 274 271 275 … … 340 344 ``Field`` 341 345 --------- 342 346 347 .. module:: django.contrib.gis.gdal.field 348 343 349 .. class:: Field 344 350 345 351 .. attribute:: name … … 420 426 ``Driver`` 421 427 ---------- 422 428 429 .. currentmodule:: django.contrib.gis.gdal 430 423 431 .. class:: Driver(dr_input) 424 432 425 433 The ``Driver`` class is used internally to wrap an OGR :class:`DataSource` driver. … … 730 738 731 739 An alias for :attr:`tuple`. 732 740 741 .. module:: django.contrib.gis.gdal.geometries 742 733 743 .. class:: Point 734 744 735 745 .. attribute:: x … … 805 815 ``OGRGeomType`` 806 816 --------------- 807 817 818 .. currentmodule:: django.contrib.gis.gdal 819 808 820 .. class:: OGRGeomType(type_input) 809 821 810 822 This class allows for the representation of an OGR geometry type -
docs/ref/contrib/gis/geos.txt
717 717 ``PreparedGeometry`` 718 718 -------------------- 719 719 720 .. currentmodule: django.contrib.gis.geos.prepared 721 720 722 .. class:: PreparedGeometry 721 723 722 724 All methods on ``PreparedGeometry`` take an ``other`` argument, which … … 733 735 Geometry Factories 734 736 ================== 735 737 738 .. currentmodule:: django.contrib.gis.geos 739 736 740 .. function:: fromfile(file_h) 737 741 738 742 :param file_h: input file that contains spatial data -
docs/ref/contrib/gis/geoquerysets.txt
4 4 GeoQuerySet API Reference 5 5 ========================= 6 6 7 .. currentmodule:: django.contrib.gis.db.models 7 .. currentmodule:: django.contrib.gis.db.models.query 8 8 9 9 .. class:: GeoQuerySet([model=None]) 10 10 … … 1208 1208 ``Collect`` 1209 1209 ~~~~~~~~~~~ 1210 1210 1211 .. currentmodule:: django.contrib.gis.db.models 1212 1211 1213 .. class:: Collect(geo_field) 1212 1214 1213 1215 Returns the same as the :meth:`GeoQuerySet.collect` aggregate method. -
docs/ref/contrib/formtools/form-preview.txt
2 2 Form preview 3 3 ============ 4 4 5 .. module:: django.contrib.formtools 5 .. module:: django.contrib.formtools.preview 6 6 :synopsis: Displays an HTML form, forces a preview, then does something 7 7 with the submission. 8 8 … … 26 26 b. If it's not valid, redisplays the form with error messages. 27 27 3. When the "confirmation" form is submitted from the preview page, calls 28 28 a hook that you define -- a 29 :meth:`~django.contrib.formtools. FormPreview.done()` method that gets29 :meth:`~django.contrib.formtools.preview.FormPreview.done()` method that gets 30 30 passed the valid data. 31 31 32 32 The framework enforces the required preview by passing a shared-secret hash to … … 50 50 :file:`django/contrib/formtools/templates` directory, and add that 51 51 directory to your :setting:`TEMPLATE_DIRS` setting. 52 52 53 2. Create a :class:`~django.contrib.formtools. FormPreview` subclass that54 overrides the :meth:`~django.contrib.formtools. FormPreview.done()`53 2. Create a :class:`~django.contrib.formtools.preview.FormPreview` subclass that 54 overrides the :meth:`~django.contrib.formtools.preview.FormPreview.done()` 55 55 method:: 56 56 57 57 from django.contrib.formtools.preview import FormPreview … … 70 70 is the end result of the form being submitted. 71 71 72 72 3. Change your URLconf to point to an instance of your 73 :class:`~django.contrib.formtools. FormPreview` subclass::73 :class:`~django.contrib.formtools.preview.FormPreview` subclass:: 74 74 75 75 from myapp.preview import SomeModelFormPreview 76 76 from myapp.forms import SomeModelForm … … 89 89 90 90 .. class:: FormPreview 91 91 92 A :class:`~django.contrib.formtools. FormPreview` class is a simple Python class92 A :class:`~django.contrib.formtools.preview.FormPreview` class is a simple Python class 93 93 that represents the preview workflow. 94 :class:`~django.contrib.formtools. FormPreview` classes must subclass94 :class:`~django.contrib.formtools.preview.FormPreview` classes must subclass 95 95 ``django.contrib.formtools.preview.FormPreview`` and override the 96 :meth:`~django.contrib.formtools. FormPreview.done()` method. They can live96 :meth:`~django.contrib.formtools.preview.FormPreview.done()` method. They can live 97 97 anywhere in your codebase. 98 98 99 99 ``FormPreview`` templates … … 102 102 By default, the form is rendered via the template :file:`formtools/form.html`, 103 103 and the preview page is rendered via the template :file:`formtools/preview.html`. 104 104 These values can be overridden for a particular form preview by setting 105 :attr:`~django.contrib.formtools. FormPreview.preview_template` and106 :attr:`~django.contrib.formtools. FormPreview.form_template` attributes on the105 :attr:`~django.contrib.formtools.preview.FormPreview.preview_template` and 106 :attr:`~django.contrib.formtools.preview.FormPreview.form_template` attributes on the 107 107 FormPreview subclass. See :file:`django/contrib/formtools/templates` for the 108 108 default templates. 109 109 -
docs/ref/contrib/admin/index.txt
1109 1109 ``InlineModelAdmin`` objects 1110 1110 ============================ 1111 1111 1112 .. currentmodule:: django.contrib.admin.options 1113 1112 1114 .. class:: InlineModelAdmin 1113 1115 1114 1116 The admin interface has the ability to edit models on the same page as a … … 1537 1539 ``AdminSite`` objects 1538 1540 ===================== 1539 1541 1542 .. currentmodule:: django.contrib.admin 1543 1540 1544 .. class:: AdminSite(name=None) 1541 1545 1542 1546 A Django administrative site is represented by an instance of -
docs/ref/utils.txt
109 109 110 110 Extra methods that ``SortedDict`` adds to the standard Python ``dict`` class. 111 111 112 .. method:: insert(index, key, value)112 .. method:: SortedDict.insert(index, key, value) 113 113 114 114 Inserts the key, value pair before the item with the given index. 115 115 116 .. method:: value_for_index(index)116 .. method:: SortedDict.value_for_index(index) 117 117 118 118 Returns the value of the item at the given zero-based index. 119 119 … … 227 227 Methods 228 228 ~~~~~~~ 229 229 230 .. method:: add_item(title, link, description, [author_email=None, author_name=None, author_link=None, pubdate=None, comments=None, unique_id=None, enclosure=None, categories=(), item_copyright=None, ttl=None, **kwargs])230 .. method:: SyndicationFeed.add_item(title, link, description, [author_email=None, author_name=None, author_link=None, pubdate=None, comments=None, unique_id=None, enclosure=None, categories=(), item_copyright=None, ttl=None, **kwargs]) 231 231 232 232 Adds an item to the feed. All args are expected to be Python ``unicode`` 233 233 objects except ``pubdate``, which is a ``datetime.datetime`` object, and 234 234 ``enclosure``, which is an instance of the ``Enclosure`` class. 235 235 236 .. method:: num_items()236 .. method:: SyndicationFeed.num_items() 237 237 238 .. method:: root_attributes()238 .. method:: SyndicationFeed.root_attributes() 239 239 240 240 Return extra attributes to place on the root (i.e. feed/channel) element. 241 241 Called from write(). 242 242 243 .. method:: add_root_elements(handler)243 .. method:: SyndicationFeed.add_root_elements(handler) 244 244 245 245 Add elements in the root (i.e. feed/channel) element. Called from write(). 246 246 247 .. method:: item_attributes(item)247 .. method:: SyndicationFeed.item_attributes(item) 248 248 249 249 Return extra attributes to place on each item (i.e. item/entry) element. 250 250 251 .. method:: add_item_elements(handler, item)251 .. method:: SyndicationFeed.add_item_elements(handler, item) 252 252 253 253 Add elements on each item (i.e. item/entry) element. 254 254 255 .. method:: write(outfile, encoding)255 .. method:: SyndicationFeed.write(outfile, encoding) 256 256 257 257 Outputs the feed in the given encoding to ``outfile``, which is a file-like 258 258 object. Subclasses should override this. 259 259 260 .. method:: writeString(encoding)260 .. method:: SyndicationFeed.writeString(encoding) 261 261 262 262 Returns the feed in the given encoding as a string. 263 263 264 .. method:: latest_post_date()264 .. method:: SyndicationFeed.latest_post_date() 265 265 266 266 Returns the latest item's ``pubdate``. If none of them have a ``pubdate``, 267 267 this returns the current date/time.