Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Edited docs changes from [9010] and [9011]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9014 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1b58b77f0d4b23d2be7c96af34636677ddb45a85 1 parent 8c6f5c6
Adrian Holovaty authored September 11, 2008
12  docs/internals/contributing.txt
@@ -399,7 +399,7 @@ incorrect translation, or if you'd like to add a language that isn't yet
399 399
 translated, here's what to do:
400 400
 
401 401
     * Join the `Django i18n mailing list`_ and introduce yourself.
402  
-    
  402
+
403 403
     * Create translations using the methods described in the :ref:`i18n
404 404
       documentation <topics-i18n>`. For this you will use the ``django-admin.py
405 405
       makemessages`` tool. In this particular case it should be run from the
@@ -409,16 +409,16 @@ translated, here's what to do:
409 409
       strings marked for translation. It creates (or updates) a message file in
410 410
       the directory ``conf/locale`` (for example for ``pt-BR``, the file will be
411 411
       ``conf/locale/pt-br/LC_MESSAGES/django.po``).
412  
-      
  412
+
413 413
     * Make sure that ``django-admin.py compilemessages -l <lang>`` runs without
414 414
       producing any warnings.
415  
-    
  415
+
416 416
     * Repeat the last two steps for the ``djangojs`` domain (by appending the
417 417
       ``-d djangojs`` command line option to the ``django-admin.py``
418  
-      invocations.)
419  
-    
  418
+      invocations).
  419
+
420 420
     * Create a diff of the ``.po`` file(s) against the current Subversion trunk.
421  
-    
  421
+
422 422
     * Open a ticket in Django's ticket system, set its ``Component`` field to
423 423
       ``Translations``, and attach the patch to it.
424 424
 
48  docs/intro/tutorial02.txt
@@ -13,13 +13,13 @@ automatically-generated admin site.
13 13
     Generating admin sites for your staff or clients to add, change and delete
14 14
     content is tedious work that doesn't require much creativity. For that
15 15
     reason, Django entirely automates creation of admin interfaces for models.
16  
-    
  16
+
17 17
     Django was written in a newsroom environment, with a very clear separation
18 18
     between "content publishers" and the "public" site. Site managers use the
19 19
     system to add news stories, events, sports scores, etc., and that content is
20 20
     displayed on the public site. Django solves the problem of creating a
21 21
     unified interface for site administrators to edit content.
22  
-    
  22
+
23 23
     The admin isn't necessarily intended to be used by site visitors; it's for
24 24
     site managers.
25 25
 
@@ -30,18 +30,18 @@ The Django admin site is not activated by default -- it's an opt-in thing. To
30 30
 activate the admin site for your installation, do these three things:
31 31
 
32 32
     * Add ``"django.contrib.admin"`` to your :setting:`INSTALLED_APPS` setting.
33  
-    
  33
+
34 34
     * Run ``python manage.py syncdb``. Since you have added a new application
35 35
       to :setting:`INSTALLED_APPS`, the database tables need to be updated.
36  
-      
  36
+
37 37
     * Edit your ``mysite/urls.py`` file and uncomment the lines below the
38 38
       "Uncomment this for admin:" comments. This file is a URLconf; we'll dig
39 39
       into URLconfs in the next tutorial. For now, all you need to know is that
40 40
       it maps URL roots to applications. In the end, you should have a
41 41
       ``urls.py`` file that looks like this:
42  
-      
  42
+
43 43
       .. parsed-literal::
44  
-      
  44
+
45 45
           from django.conf.urls.defaults import *
46 46
 
47 47
           # Uncomment the next two lines to enable the admin:
@@ -59,7 +59,7 @@ activate the admin site for your installation, do these three things:
59 59
               # Uncomment the next line to enable the admin:
60 60
               **(r'^admin/(.*)', admin.site.root),**
61 61
           )
62  
-          
  62
+
63 63
       (The bold lines are the ones that needed to be uncommented.)
64 64
 
65 65
 Start the development server
@@ -97,17 +97,17 @@ Make the poll app modifiable in the admin
97 97
 But where's our poll app? It's not displayed on the admin index page.
98 98
 
99 99
 Just one thing to do: We need to tell the admin that ``Poll``
100  
-objects have an admin interface. Create a file called ``admin.py`` in your 
101  
-``polls`` application and edit it to look like this:: 
  100
+objects have an admin interface. To do this, create a file called
  101
+``admin.py`` in your ``polls`` directory, and edit it to look like this::
102 102
 
103 103
     from mysite.polls.models import Poll
104 104
     from django.contrib import admin
105  
-    
  105
+
106 106
     admin.site.register(Poll)
107 107
 
108  
-You will need to restart the development server to see your changes. Normally
109  
-the server will auto-reload itself every time you modify a file, but here the
110  
-action of creating a new file will not trigger the auto-reloading logic.
  108
+You'll need to restart the development server to see your changes. Normally,
  109
+the server auto-reloads code every time you modify a file, but the action of
  110
+creating a new file doesn't trigger the auto-reloading logic.
111 111
 
112 112
 Explore the free admin functionality
113 113
 ====================================
@@ -133,12 +133,12 @@ Click the "What's up?" poll to edit it:
133 133
 Things to note here:
134 134
 
135 135
     * The form is automatically generated from the Poll model.
136  
-    
  136
+
137 137
     * The different model field types (:class:`~django.db.models.DateTimeField`,
138 138
       :class:`~django.db.models.CharField`) correspond to the appropriate HTML
139 139
       input widget. Each type of field knows how to display itself in the Django
140 140
       admin.
141  
-    
  141
+
142 142
     * Each :class:`~django.db.models.DateTimeField` gets free JavaScript
143 143
       shortcuts. Dates get a "Today" shortcut and calendar popup, and times get
144 144
       a "Now" shortcut and a convenient popup that lists commonly entered times.
@@ -147,13 +147,13 @@ The bottom part of the page gives you a couple of options:
147 147
 
148 148
     * Save -- Saves changes and returns to the change-list page for this type of
149 149
       object.
150  
-      
  150
+
151 151
     * Save and continue editing -- Saves changes and reloads the admin page for
152 152
       this object.
153  
-      
  153
+
154 154
     * Save and add another -- Saves changes and loads a new, blank form for this
155 155
       type of object.
156  
-      
  156
+
157 157
     * Delete -- Displays a delete confirmation page.
158 158
 
159 159
 Change the "Date published" by clicking the "Today" and "Now" shortcuts. Then
@@ -178,13 +178,13 @@ Let's see how this works by reordering the fields on the edit form. Replace the
178 178
 
179 179
     class PollAdmin(admin.ModelAdmin):
180 180
         fields = ['pub_date', 'question']
181  
-        
  181
+
182 182
     admin.site.register(Poll, PollAdmin)
183 183
 
184 184
 You'll follow this pattern -- create a model admin object, then pass it as the
185 185
 second argument to ``admin.site.register()`` -- any time you need to change the
186 186
 admin options for an object.
187  
-    
  187
+
188 188
 This particular change above makes the "Publication date" come before the
189 189
 "Question" field:
190 190
 
@@ -202,7 +202,7 @@ up into fieldsets::
202 202
             (None,               {'fields': ['question']}),
203 203
             ('Date information', {'fields': ['pub_date']}),
204 204
         ]
205  
-        
  205
+
206 206
     admin.site.register(Poll, PollAdmin)
207 207
 
208 208
 The first element of each tuple in ``fieldsets`` is the title of the fieldset.
@@ -235,9 +235,9 @@ Yet.
235 235
 
236 236
 There are two ways to solve this problem. The first register ``Choice`` with the
237 237
 admin just as we did with ``Poll``. That's easy::
238  
-    
  238
+
239 239
     from mysite.polls.models import Choice
240  
-    
  240
+
241 241
     admin.site.register(Choice)
242 242
 
243 243
 Now "Choices" is an available option in the Django admin. The "Add choice" form
@@ -268,7 +268,7 @@ registration code to read::
268 268
     class ChoiceInline(admin.StackedInline):
269 269
         model = Choice
270 270
         extra = 3
271  
-        
  271
+
272 272
     class PollAdmin(admin.ModelAdmin):
273 273
         fieldsets = [
274 274
             (None,               {'fields': ['question']}),

0 notes on commit 1b58b77

Please sign in to comment.
Something went wrong with that request. Please try again.