#11126: Admin model.ManyToManyField doesn't support  legacy db tables and custom
model.ForeignKey fields
------------------------------------------------+---------------------------
          Reporter:  mwil...@methodstudios.com  |         Owner:  nobody
            Status:  closed                     |     Milestone:        
         Component:  django.contrib.admin       |       Version:  SVN   
        Resolution:  invalid                    |      Keywords:        
             Stage:  Unreviewed                 |     Has_patch:  0     
        Needs_docs:  0                          |   Needs_tests:  0     
Needs_better_patch:  0                          |  
------------------------------------------------+---------------------------
Comment (by anonymous):

 Although the above is not a true bug, it is something that's difficult to
 work with and non-intuitive. So consider this a vote for a new feature
 request. The root problem is not configuration of the admin interface, it
 is that if you use the "through" parameter it assumes you have additional
 data that needs to be added. This is rarely the case in a legacy database
 situation.

 There are a couple possible solutions:
 1. Have the ORM inspect the through model and find the correct foreign key
 fields to make normal manytomany functionality work (like add() or admin
 forms).
 2. Allow two more optional parameters (or a tuple or something), to allow
 manually naming the foreign key fields.

 This would allow a legacy m2m behave like a native one when there's no
 additional data (which is most of the time). I work in a corporate setting
 where getting django to connect to "legacy" data (any database not created
 by django) is indispensable, and this will only become more common when
 the multi-db branch lands in the trunk.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11126#comment:2>
Django <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 django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to