Hi,

On Apr 3, 5:16 pm, Jared <[EMAIL PROTECTED]> wrote:
> I have something of an odd question, I think...  I have a couple of
> objects setup something like this (there are more fields, but this
> seems to be enough of a relevant example)...
>
> class table(models.Model):
>     name = models.CharField()
>
> class cell(models.Model):
>     name = models.CharField()
>     table = models.ForeignKey(category)

Did you mean to say ForeignKey(table) here? If so, see below:

>     row = models.IntegerField()
>     col = models.IntegerField()
>
> Is it possible, from the table object to determine which cell objects
> are marked as being in row 1?

Let's say your table object is t_obj. Then you can do:

row_one_cells = t_obj.cell_set.filter(row=1)

-Rajesh D
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to