Re: how to get class name from a relation name

2007-08-27 Thread Grégoire Cachet
Thanks Russell, it works with the get_accessor_name() method combinated with the model attribute. 2007/8/23, Russell Keith-Magee <[EMAIL PROTECTED]>: > > > On 8/22/07, Grégoire Cachet <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I would like to get the class name from a relation name (OneToOne) > ..

Re: how to get class name from a relation name

2007-08-22 Thread Russell Keith-Magee
On 8/22/07, Grégoire Cachet <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to get the class name from a relation name (OneToOne) ... > I want to get the class of the object a.modelb (ie ModelB) without > instanciating a ModelA. Is there a clever way to get it from the model > definition ? or do

how to get class name from a relation name

2007-08-22 Thread Grégoire Cachet
Hi, I would like to get the class name from a relation name (OneToOne) For example : class ModelA(models.Model): label = models.CharField(max_length=255) class ModelB(models.Model): a = models.OneToOneField(ModelA) class ModelC(models.Model): a = models.OneToOneField(ModelA) If I