I'm prototyping ideas for a project management tool. It supports
multiple projects per site, but I'm not sure how to define permissions
on a per project basis. Currently I have:

class Project(models.Model):

        title = models.CharField(max_length=128)
        description = models.TextField()
        members = models.ManyToManyField(User, through='Membership')

        class Meta:
                        permissions = (
                                ("is_member", "Is a member"),
                        )

class Membership(models.Model):
        user = models.ForeignKey(User)
        project = models.ForeignKey(Project)
        role = models.CharField(max_length=120)


This is fine except I want to re-use Django's permissions. But I can't
see how to do this as the permissions table is rebuilt when the DB is
resyncedd so there's no guarantee that the ID of a particular
permission is consistent. Or is this a non-issue? Any ideas on the
best way to implement this?

I also considered using the Sites feature, where a site is basically a
project, but I want users to be able to creates projects via the web
interface, so creating a new settings.py file isn't too realistic.

Comments welcome. Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to