Re: Accessing FK sets in model methods

2007-07-19 Thread Ilan
Correct. I over looked a few basics. On 19 יולי, 04:58, "Ben Ford" <[EMAIL PROTECTED]> wrote: > This error message is to do with a syntax error... It doesn't have anything > to do with django specifically. If you've cut and pasted verbatim, then you > need a colon ( : ) at the end of your if

Re: Accessing FK sets in model methods

2007-07-18 Thread Ben Ford
This error message is to do with a syntax error... It doesn't have anything to do with django specifically. If you've cut and pasted verbatim, then you need a colon ( : ) at the end of your if > 0 line. This is what python is flagging as an error as far as i can see. Ben On 18/07/07, Ilan

Re: Accessing FK sets in model methods

2007-07-18 Thread Ilan
You're correct I did have a extra space, but the original problem was syntax error on the following line : if self.segment_set.count() > 0 so my question is : can I acess to FK queryset as described in http://www.djangoproject.com/documentation/db-api/#Backward in a model method thanks On 18

Re: Accessing FK sets in model methods

2007-07-18 Thread Tim Chase
> Can someone point me to the problem? > > class Base(models.Model): > User = models.CharField(maxlength=200) > Notes = models.CharField(maxlength=200) # free text > > def _first_date(self): >""" Return the first date """ > if self.segment_set.count() > 0 >

Accessing FK sets in model methods

2007-07-18 Thread Ilan
Hi, My name is Ilan, and I kind of new working with Django. I have a question about model methods. I trying to write a model method which access ForeignKey FOO_set functionality Whoever it does not seems to pass the "syncdb" validation, because of invalid syntax Can someone point me to the