Re: Last object of a set?

2009-09-03 Thread watusee
f forloop.first %} >         {{ course_part.begin_date }} >     {% endif %} > >     {% if forloop.last %} >        {{ course_part.end_date }} >     {% endif %} > {% endfor %} > > HTH, > Brandon > > On Sep 3, 11:01 pm, watusee wrote: > > > I'm attempting to get the first a

Last object of a set?

2009-09-03 Thread watusee
I'm attempting to get the first and last items in a set inside a django template. The first is no problem: {{ course.coursepart_set.all.0.begin_date }} but I can't figure out how to get the last item without knowing the length of the set. Is there a way to do this? Something like (theoretically

1.02 Bug with Flatpages and Append_Slash?

2008-11-23 Thread watusee
Picture a site with a flatpage at the root. This root flatpage in the admin tool has a "/" for the URL. The root flatpage gets into a redirect loop. All other flatpages except the root flatpage work fine. If Append_Slash is set to false, this perplexing behavior no longer occurs and the root flatp

Re: flatpage at root/home?

2008-11-23 Thread watusee
> try replacing: >  (r'', include('django.contrib.flatpages.urls')), > > with >  (r'^$', include('django.contrib.flatpages.urls')), > > On Nov 23, 6:48 am, watusee <[EMAIL PROTECTED]> wrote: > > > Upgraded from 96 to 1.02. My hom

flatpage at root/home?

2008-11-23 Thread watusee
Upgraded from 96 to 1.02. My home/root (at 127.0.0.1/) page (using flatpages) now doesn't work using runserver. Other flatpages are working fine. The entry in the urlconf looks like this: urlpatterns = patterns('', #(r'^works/$', 'django.views.generic.list_detail.object_list', dict (work_dict

Re: Ordering by Foreign Key in Admin

2008-03-02 Thread watusee
e I might be missing something here and I'd much prefer the better solution! Thanks again for your help. On Mar 2, 12:11 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-03-01 at 20:02 -0800, watusee wrote: > > Using the manual Many t

Ordering by Foreign Key in Admin

2008-03-01 Thread watusee
Using the manual Many to Many model as follows in revision 7188 # class Book(models:Model): name = models.CharField(max_length=64) class Admin: pass class Author(models:Model): name = models.CharField(max_length=64) class Admin: pass class B

Re: request for generic views functionality...

2007-04-14 Thread watusee
at neither of these appropriately match > your problem. In that case, why not write your own 4-line view? You > can even use > function wrappers (in python > 2.3, decorator syntax) to maintain DRY. > > Hope this helps. > > Cheers, > Mike Axiak > > On Apr 13, 11:59 pm

request for generic views functionality...

2007-04-13 Thread watusee
Greetings all. I have a problem/concept I've been struggling with. I have an app called News with three models: Article, Press Release and Event. Each model has some fields in common (headline, date, body) and other fields unique to each model. I had initially thought to combine the three models i