Re: How to get the value of ForeignKey

2009-03-09 Thread uprising
I don't know if it can be done without extra, maybe something like this (I have not tested it): Homeloan.objects.extra( select={"banker_category": "appname_bankercategory.name"}, tables = ["appname_bankercategory", "appname_banker"], where = ["appname_bankercategory.id = a

Re: How to get the value of ForeignKey

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 7:24 AM, guptha wrote: > > thanks for your reply > but i cannot solve my problem i will make my question clear this time > > > class BankerCategory(models.Model): >name = models.CharField(max_length=125,unique=True) > created_on = models.DateTimeField(auto_now_add=T

Re: How to get the value of ForeignKey

2009-03-09 Thread guptha
thanks for your reply but i cannot solve my problem i will make my question clear this time class BankerCategory(models.Model): name = models.CharField(max_length=125,unique=True) created_on = models.DateTimeField(auto_now_add=True) class Banker(models.Model): name = models.Char

Re: How to get the value of ForeignKey

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 03:54 -0700, guptha wrote: > hi gp, > In models.py > > class BankerCategory(models.Model): > name = models.CharField(max_length=125,unique=True) > > class Banker(models.Model): > bankercategory = models.ForeignKey(BankerCategory) >

How to get the value of ForeignKey

2009-03-09 Thread guptha
hi gp, In models.py class BankerCategory(models.Model): name = models.CharField(max_length=125,unique=True) class Banker(models.Model): bankercategory = models.ForeignKey(BankerCategory) class Homeloan(models.Model): banker = model