On 17 March 2011 16:18, Mike Axiak <mcax...@gmail.com> wrote: > Just to be clear, for this to be valid syntax doesn't this idea have to be > written as:: > class Foo(Model): > x = models.FloatField() > y = models.FloatField() > coords = models.CompositeField(('x', 'y'), db_index=True) > a = models.ForeignKey(A) > b = models.ForeignKey(B) > pair = models.CompositeField(('a', 'b'), primary_key=True) > (Note the quotes around the field names.)
Actually, it works without the quotes as long as the fields are defined in the same class before the CompositeField: http://ideone.com/LPNzS -- Łukasz Rekucki -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.