#4667: [newforms-admin] add edit_inline support for generic relations
-------------------------------------------------------------+--------------
   Reporter:  Honza Král <[EMAIL PROTECTED]>              |                
Owner:  Honza_Kral     
     Status:  new                                            |            
Component:  Admin interface
    Version:  newforms-admin                                 |           
Resolution:                 
   Keywords:  edit_inline generic content_type sprintsept14  |                
Stage:  Accepted       
  Has_patch:  1                                              |           
Needs_docs:  0              
Needs_tests:  0                                              |   
Needs_better_patch:  1              
-------------------------------------------------------------+--------------
Comment (by Honza_Kral):

 I moved all the code except few things (enable {{{formset}}} overriding
 and something to prevent circular imports) out of {{{admin}}} and directly
 into {{{contenttypes.generic}}}

 This will enable me to specify my generic inlines like
 {{{
 class ListingInlineOptions( generic.GenericTabularInline ):
     model = Listing
     extra = 2
     ct_field_name = 'target_ct'
     id_field_name = 'target_id'
 }}}

 The downside is that I am duplicating some code in
 {{{contenttypes.generic}}}

 There are few more things to do:
  1. Find better names than {{{id_field_name}}} and {{{ct_field_name}}}
  1. Enable this to work with autodetection and/or {{{GenericForeignKey}}}
  1. clean-up the code in {{{contenttypes.generic}}} (maybe refactor admin
 a bit to enable getting rid of some boilerplate code)
  1. Enjoy :)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/4667#comment:9>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to