Hey,

most of the options on a ModelAdmin control the display of your model,
and how you interact with it, in the admin site. What fields you want
to show in the table (list_display), how many objects per page
(list_per_page) and so on:

ModelAdmin options: 
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-options

Whereas fields options in your Model let you further define your
model's specification. You already define what fields your model
consists of, and with unique_for_date you add another constraint to
your model field. It may be enforced on the admin form level, but I
think the only reason for this is, that enforcing it on the database
level is actually not possible, or not reasonable - and maybe it will
be enforced on the database level some day.

Field options on models: 
http://docs.djangoproject.com/en/dev/ref/models/fields/#field-options

So think of the ModelAdmin options as a mean to control (mostly)
display and interaction with the model, and field options as further
constraints to your model. You want your model specification to be in
only one place, and that would be in the model itself.

Regards,
Reiner

On May 19, 2:19 am, Mohan Parthasarathy <surut...@gmail.com> wrote:
> Hi,
>
> I can see that Models don't use the inner class to define the options, so I
> used
>
> class EntryAdmin(admin.ModelAdmin):
>         prepopulated_fields = {'slug' : ('title',)}
>
> How do I use unique_for_date here ? Is there a place where all the options
> are listed for this new style interface ?
>
> I can see that unique_for_date works when added to the field directly which
> confuses me as I thought anything to do with admin interfaces
> (unique_for_date is controlled at the admin level and not at database level
> ?) is specified separately. What am i missing ?
>
> -mohan
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to