I have a model with a ManyToManyField. I want to return all the
instances where this M2M field has specific instances of the table
that the M2M field points at.
For example. Model.objects.filter(m2mfield__id=1,m2mfield__id=2), so
in theory this would return results in which the objects with pri
Seems to work fine if I build the query using Q's and then only use
filter one.
On Jun 19, 11:33 am, IanR wrote:
> Anyone have any ideas?
>
> q2 and q3 should return the same results.
>
> >>> from testing.models import Building
> >>> from testing.models
Anyone have any ideas?
q2 and q3 should return the same results.
>>> from testing.models import Building
>>> from testing.models import Unit
>>> b1 = Building(name="Bld 1")
>>> b1.save()
>>> u1 = Unit(building=b1,bedrooms=1,bathrooms=1)
>>> u1.save()
>>> u2 = Unit(building=b1,bedrooms=2,bathroo
I've recreated this behavior with the following examples. (using
1.0)
#models.py
class Building(models.Model):
name = models.CharField(max_length=10)
floors = models.IntegerField()
class Unit(models.Model):
unit_number = models.IntegerField()
bedrooms = models.IntegerField()
building
I have a grid of 51 items that I want to display in 6 columns.. Column
1-5 contain 9 elements, Column 6 contains 6 elements.
This is done by creating 6 div's that are float-left and only 50px
wide. So what I would do is just count in a for loop and when I hit
the row limit just output a "" and i
essor is made how would I add it
to this list? Something like
settings.TEMPLATE_CONTEXT_PROCESSORS.append(my_processor)
On Mar 29, 7:19 pm, David Zhou wrote:
> On Sun, Mar 29, 2009 at 7:14 PM, IanR wrote:
> > I'm trying to stay a close to the suggested Django conventions as
> >
I'm currently converting my website from PHP to Django. I've always
loved python and all my backend code is in python. I figured that it
might as well make the jump. So far so good, as everything has been
very strait forward and a joy. It's definitely making web development
fun again.
I'm try
7 matches
Mail list logo