| 230 | }}} |
| 231 | |
| 232 | === Inline editing === |
| 233 | |
| 234 | The syntax is now different and much, much better. |
| 235 | |
| 236 | Here is an example: |
| 237 | An example: |
| 238 | {{{ |
| 239 | #!python |
| 240 | from django.contrib import admin |
| 241 | class Child_Inline(admin.TabularInline): |
| 242 | model = Child |
| 243 | extra = 3 |
| 244 | |
| 245 | class Parent_admin(admin.ModelAdmin): |
| 246 | model = Parent |
| 247 | inlines = [Child_Inline] |
| 248 | }}} |
| 249 | |
| 250 | === Moved raw_id_admin from the model definition === |
| 251 | |
| 252 | The syntax now seperates from the definition of your models. |
| 253 | |
| 254 | An example: |
| 255 | {{{ |
| 256 | #!python |
| 257 | # OLD: |
| 258 | class MyModel(models.Model): |
| 259 | field1 = models.ForeignKey(AnotherModel, raw_id_admin=True) |
| 260 | class Admin: |
| 261 | pass |
| 262 | |
| 263 | # NEW: |
| 264 | class MyModel_Options(admin.ModelAdmin): |
| 265 | model = MyModel |
| 266 | raw_id_fields = ('field1') |
| 267 | }}} |
| 268 | }}} |
| 269 | |