#1836: Decouple Admin inner class from Model
---------------------------------+------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |        Owner:  adrian
     Type:  defect               |       Status:  new   
 Priority:  low                  |    Milestone:        
Component:  Metasystem           |      Version:        
 Severity:  normal               |   Resolution:        
 Keywords:                       |  
---------------------------------+------------------------------------------
Comment (by [EMAIL PROTECTED]):

 Perhaps the name of the ticket is misleading; I'm not proposing that you
 remove Admin inner classes from model definitions (in other words, make
 them non-inner classes), thus violating DRY. I'm proposing that the
 behind-the-scenes logic that deals with actually handling Admin inner
 classes be taken out of the base Model class, since this currently couples
 (albeit weakly) the basic database model to a specific application (the
 administrative interface). One way to implement this (probably not the
 only way, and possibly undesirable, since it would break backwards
 compatibility / require code changes on the user end) is to require Admin
 inner classes to subclass a class that provides, via metaclassing, the
 same features as the AdminOptions class invoked in the add_to_class
 method, and also implements contribute_to_class. If this were done, the
 first three lines of Models' add_to_class classmethod could be deleted,
 eliminating the coupling between the Model class and the administrative
 interface application.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/1836>
Django <http://code.djangoproject.org/>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to