On 12/19/08, Peter <pe...@monicol.co.uk> wrote:
>
>
>  >
>  > You could make such a check and deny the saving of a new FrontPage
>  > object by overloading the save() method of class FrontPage.
>  > Source in trunk: django/db/models/base.py.
>  >
>  > Regards, James.
>
>
> Thanks James.
>
>  Yes - I see that would work - but it involves coding and I was looking
>  for a more 'declarative'
>  way.

Why?
The really proper way to do that is to store the sole FrontPage model
in a json file, the file-system is better suited than a RDBMS to store
one single instance of a single structure IMHO.

>  I'll give the user permission to change a FrontPage instance but not
>  delete or add one. The real admin user
>  will have just to avoid adding / deleting but this user ain't used
>  (much). In the FrontPage view I can check
>  that the original view is being used (perhaps by looking for pk==1 or
>  something).   The main thing is that this
>  switches off the admin template buttons 'x delete' '+add' etc.

You might also overload default admin templates for FrontPage, but
permissions allow security.

>  What I was looking for was a global permission that could be set on a
>  model when it was defined which set
>  default permissions for 'staff' on the model (or even for superuser)
>  on that model.

Why not just create another group?

Don't forget to save your permissions in
yourapp/data/initial_data.json with the help of the dumpdata
management command, since it's consistence critical.

Regards, James.

--~--~---------~--~----~------------~-------~--~----~
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