Re: Query spanning two foreign keys

2008-11-16 Thread Will McCutchen
On Nov 15, 7:55 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > This should do the job: > >         User.objects.filter(posts__parent__pk=1).distinct() That does the trick. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Query spanning two foreign keys

2008-11-15 Thread Will McCutchen
Hi all, I've got the following models (simplified for this example): from django.db import models from django.contrib.auth.models import User class Chat(models.Model): name = models.CharField(max_length=256) class Post(models.Model): user = models.ForeignKey(User, related_name='posts')

Re: def __str__(self) error in tutorial part 1

2007-10-03 Thread Will McCutchen
Hi, On Oct 2, 1:18 pm, rhett <[EMAIL PROTECTED]> wrote: > 1) I am working in TextMate and copied/pasted below code. In TextMate > the "def __str__(self)" is not indented from the pub_date line - it's > the same indent. I too use TextMate to do a lot of my Python development. It consistently ove

Re: Problem using external CSS file with template

2007-08-21 Thread Will McCutchen
Hi, On Aug 21, 1:44 pm, arelenas <[EMAIL PROTECTED]> wrote: > I've set URLConf as described > athttp://www.djangoproject.com/documentation/0.96/static_files/, > but still nothing. It finds CSS file but styles won't apply. What does your URLConf look like? What is the URL you are using to link

Re: Can a ManyToManyField only shows certain records in an admin using edit_inline?

2007-08-01 Thread Will McCutchen
> Is there anyway that I can have the 'sandp' Field only > show choices that are tied to that collection? Try using the limit_choices_to argument to ManyToManyField: http://www.djangoproject.com/documentation/model-api/#many-to-many-relationships Hope this helps, Will. --~--~-~--~---

Re: Path/Environment problem (may be Mac-specific)

2007-04-04 Thread Will McCutchen
On Apr 4, 1:16 pm, "Richard Blumberg" <[EMAIL PROTECTED]> wrote: > ImportError: No module named django.db > > I can't figure out why it works from the standard python shell but not from > within BBEdit. Perhaps this is a question for the BBEdit list rather than > the Django list, but if anyone her

Re: currently online users?

2007-01-23 Thread Will McCutchen
On Jan 23, 1:18 pm, "Rob Hudson" <[EMAIL PROTECTED]> wrote: > I don't have an answer but some thoughts... Me, too... > I'd probably go with the 3rd option. But if that didn't work, maybe > look at writing my own session middleware that added new column to the > django_session table that was a