On 21 Jul 2006, at 17:55, Elver Loho wrote:

>> I wonder if you could be a bit more explicit here... I can't think of
>> a single place where you "just set a variable and have it do
>> something cool", so I'd like to know more about what scares you.
>
> The admin module? http://www.djangoproject.com/documentation/ 
> tutorial2/

Is it the inner class that you found disturbing?

class Poll(models.Model):
     # ...
     class Admin:
         pass

If so, you should know that the actual admin framework itself is a  
completely separate application from the rest of Django - it was  
refactored out of the core nearly a year ago, and now lives in  
django.contrib. The model classes are a collection of useful metadata  
about the models, and the admin framework needs a bunch of metadata  
to decide how to behave. The (in my opinion very smart) decision was  
made to pull that out in to an inner class. This sets a nice  
precedence for extending Django's model syntax in the future - for  
example, I think there has been talk about having a 'class Search'  
inner class with parameters for controlling how a proposed Search  
contrib application should index models.

There's no magic here - just a neat way of adding namespaced metadata  
to models without cluttering things up too much.

Cheers,

Simon

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

Reply via email to