Changes between Version 27 and Version 28 of NewformsAdminBranch


Ignore:
Timestamp:
Sep 16, 2007, 1:56:50 AM (17 years ago)
Author:
jdetaeye@…
Comment:

More updates around migrating to newforms-admin

Legend:

Unmodified
Added
Removed
Modified
  • NewformsAdminBranch

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