Friday, June 11, 2010

Controlling access to objects

Hi guys,
I don't know whether the built-in permissions system would be
appropriate here, but I want to control access to objects in one of my
models, based on profile fields, like gender, age, etc.

I planned to create a model "MyModelPermissions" like so:
class MyModelPermissions(models.Model):
mymodel = models.OneToOneField(MyModel)
gender = models.CharField(choices=[('male', 'Male'),('female',
'Female'), ('both', 'Both')])
....

But that doesn't seem very efficient. Any ideas on how best to do this?

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate