Hi,

I just finished migrating an application that uses the admin interface
to the new admin.
It took me quite a while to gather all changes correctly from the
mailing list, google search through tickets, and looking at the
code, ...  :-(

Does it make sense to update the page 
http://code.djangoproject.com/wiki/NewformsAdminBranch
with more complete information for people to make the move?
Or do you have a different mechanism in mind to help people
migrating?
Or is the newforms-admin branch still too much on-the-move to do so?

Some extra migration information I believe people like me would be
interested in:

1) Registering code and how to handle it.
The wiki shows an example but doesn't go as far as to give people a
clear guideline / best practice on how to best handle the registration
of your admin classes.
I put the admin classes in a file admin.py and added an import
statement in the __init__.py file of my application directory.  Not
sure whether this is the best and recommended way...

2) Rename 'fields' to 'fieldsets'
'fields' is still used, but it accepts only a list of fields.
In case one uses fieldsets to organize the fields, one needs to use
'fieldsets' instead.
If you forget to rename the field, you get an error message that is
very hard to relate back to its root cause.

3) Inlined models
The syntax is now different and much, much better. Not sure whether
the dust is completely settled on the new syntax...
You need code like:
       from django.contrib import admin
       class Child_Inline(admin.TabularInline):
           model = Child
           extra = 3
       class Parent_admin(admin.ModelAdmin):
           inlines = [Child_Inline]

4) raw_id_admin
The syntax is now (rightly) seperated from the definition of your
models.
In your adminoption classes one needs:
       class YourModelAdmin(admin.ModelAdmin):
           raw_id_fields = ('field1', 'field2')

When given a green light I am willing to update the wiki page with
this above information.

My 2 cents,

Johan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to