Wednesday, October 27, 2010

Re: Custom permissions

Hello Narciso,

Did you run manage.py syncdb from the command line in your project?

On Oct 27, 8:06 am, Narciso Oceguera <narc...@sih.cu> wrote:

> I just added the lines:
>
> class USCitizen(models.Model):
>     # ...
>
>     class Meta:
>         permissions = (
>             ("can_drive", "Can drive"),
>             ("can_vote", "Can vote in elections"),
>             ("can_drink", "Can drink alcohol"),
>         )
>
> as documentation said.
>
> But I can't get my permission added in the Permission table. I take a
> look at auth code and it add the permissions found in
> model._meta.permission attribute ( opts.permissions )
> I look arround the model at the interactive shell and I found that these
> permission were added to the model object itself, not the _meta attribute.
> Because of that, my custom permission were not added to the permission
> table.
>
> Is this an django bug? How can I fix this problem, without modified
> django source?
> or
> There is something wrong in my code?

Toodle-looooooooooo........
creecode

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment