Re: method of method

2011-01-26 Thread Jaroslav Dobrek
Thanks to all of you. Now I understand this better. Jaroslav -- 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+unsubs

Re: method of method

2011-01-25 Thread Tom Evans
On Tue, Jan 25, 2011 at 11:41 AM, Jaroslav Dobrek wrote: >>> What happens ? > > I get this error message when I run manage.py syncdb: > > AttributeError: 'ForeignKey' object has no attribute 'producer' > >>> And what did you expect to happen ? > > I want the 'country_of_origin' of cars to be the s

Re: method of method

2011-01-25 Thread bruno desthuilliers
On 25 jan, 12:41, Jaroslav Dobrek wrote: > >> What happens ? > > I get this error message when I run manage.py syncdb: > > AttributeError: 'ForeignKey' object has no attribute 'producer' > > >> And what did you expect to happen ? > > I want the 'country_of_origin' of cars to be the string that is

Re: method of method

2011-01-25 Thread nleite
Hi there, Are you sure that you want to denormalize your schema like that ? I now this is a totally different issue and question but in this case do you really need to perform this operation ? Have considered the problems that this approach will bring? Imagine this simple use case: If one changes

Re: method of method

2011-01-25 Thread Jaroslav Dobrek
On 25 Jan., 12:36, Euan Goddard wrote: > I agree with the previous poster - the title is misleading as the word > "method" is incorrect in both places. O.k. sorry. Should have been "attribute of attribute", right? -- You received this message because you are subscribed to the Google Groups "

Re: method of method

2011-01-25 Thread Jaroslav Dobrek
>> What happens ? I get this error message when I run manage.py syncdb: AttributeError: 'ForeignKey' object has no attribute 'producer' >> And what did you expect to happen ? I want the 'country_of_origin' of cars to be the string that is stored in their producer's 'country_of_origin': class C

Re: method of method

2011-01-25 Thread Euan Goddard
I agree with the previous poster - the title is misleading as the word "method" is incorrect in both places. It seems that the original poster is talking about denormalizing data. However, this is unnecessary as the ORM allows for this type of data to be retrieved any how, e.g. Car.objects.all().s

Re: method of method

2011-01-25 Thread bruno desthuilliers
On 25 jan, 11:57, Jaroslav Dobrek wrote: > Hi, > > can I use methods of methods in Django? What's a "methods of methods" ??? > Like so: > > class Car(models.Model): >     producer = models.ForeignKey(CarProducer) >     country_of_origin = producer.country_of_origin What is CarProducer.country

method of method

2011-01-25 Thread Jaroslav Dobrek
Hi, can I use methods of methods in Django? Like so: class Car(models.Model): producer = models.ForeignKey(CarProducer) country_of_origin = producer.country_of_origin This doesn't seem to work. Is there a special syntax for this? Jaroslav -- You received this message because you are