Finding unique ForeignKey enties.

2009-09-22 Thread MV
I have a Movie model and I have a Image model the Image model has a ForeignKey(Movie) Each Movie has an arbitrary amount of Images. I have a view where I list all the Movies. For each Movie entry, I want one Image. How do I do that? I can do a "movies = Movies.objects.all()" and pass "movies"

Re: Checking if 2 db-entries exist

2009-09-19 Thread MV
MV wrote: > I need to check if 2 different entries in the database exist, and serve > different variables to the template if > 1. they both exists > 2. if only the first one exists > 3. if only the last one exists > 4. if none exists. > > - > MV > > > > &g

Checking if 2 db-entries exist

2009-09-18 Thread MV
I need to check if 2 different entries in the database exist, and serve different variables to the template if 1. they both exists 2. if only the first one exists 3. if only the last one exists 4. if none exists. - MV --~--~-~--~~~---~--~~ You received

Question about class variables

2009-02-16 Thread MV
Hi there, I have a question about class variables in Django. If I create a custom field, e.g. class TinyMCEField(models.Field): superadmin = False def formfield(self, **kwargs): if superadmin: defaults = {'widget':TinyMCE(... blah blah blah})} else: