On 9/28/07, eXt <[EMAIL PROTECTED]> wrote: > > Hi! > > Custom content types without a model give me a lot of flexibility. > For example: > > 1. I've got a bunch of reports which are generated by Jasper Reports. > In my Django app I have some groups of users and each of them should > see a different subset of reports. Reports are not defined in my > database so I don't have a model but of course I'd like to define some > permissions like: "Can execute report X", "Can execute report Y" etc. > and assign the permissions to user groups and single users. > > 2. I have models like "Cars", "Houses", "Books".. anything. Each > record has a column 'entry_author'. I need a permission to determine > whether an user "Can see entry author" or not. Where should I define > it in this case? I don't have an access to auth.models.User to set > permission there. > > In both cases the easiest and cleanest way to solve my problems was to > define custom content type and set permissions on it. >
Hrrmmmm... I see your point about each, at least as a use case. I think there are ways to get what you want without, though. For case #1, I'd opt to create an entry for the reports in my DB to pair them with users/groups, which would allow custom permissions. For #2, I'd create an Author class with a fk relationship to User and create permissions that way. The content types app assumes each content type is for an installed app. That's the whole point really -- to create a generic way to refer to objects within an app, or across apps. Since your issue is permissions, I'd try to hang my permissions on actual models. This is just how I'd handle the same requirements. Others may see a need for content types being decoupled from installed apps. Cheers, deryck --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@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-developers?hl=en -~----------~----~----~----~------~----~------~--~---