Re: How to use the foreign key to get the exact row of that particular table ?

2011-06-24 Thread Tom Evans
On Thu, Jun 23, 2011 at 11:27 PM, Satyajit Sarangi wrote: > My models.py is this > > class PermiLayer(models.Model): >    user = models.ForeignKey(User) >    table = models.ForeignKey(ContentType) >    permi = models.IntegerField() > > My views.py is this > > perm.table = > ContentType.objects.get

Re: How to use the foreign key to get the exact row of that particular table ?

2011-06-24 Thread Daniel Roseman
On Thursday, June 23, 2011 11:27:53 PM UTC+1, Satyajit Sarangi wrote: > > My models.py is this > > class PermiLayer(models.Model): > user = models.ForeignKey(User) > table = models.ForeignKey(ContentType) > permi = models.IntegerField() > > My views.py is this > > perm.table = >

How to use the foreign key to get the exact row of that particular table ?

2011-06-23 Thread Satyajit Sarangi
My models.py is this class PermiLayer(models.Model): user = models.ForeignKey(User) table = models.ForeignKey(ContentType) permi = models.IntegerField() My views.py is this perm.table = ContentType.objects.get(app_label="OsmMap",model="osmlayers") Perm.table is storing an integer .