Re: URLPattern - can't fetch a detail page

2007-05-21 Thread Martin Glueck
Looking at the urls pattern reported in the 404 page it looks like there is twice the "^" symbol. And I would say that is the problem because this symbol tries to match the "start of a line", so the pattern "^news/ ^/(?P[a-zA-Z0-9-_]+)/?$" will never match to "/news/hello/". my guess is that you "

Re: Simple Template Syntax Question: ljust

2006-09-25 Thread Martin Glueck
> I've tried... > > {{product.title | ljust 40}} > > and other formats but can't get it to work... You can use the slice filter: {{product.title | slice:":40" }} or if you what the to truncate only at workbrakes, you can use the truncatewaords filter: {{product.title | truncate:"5" }} Marti

Re: python syntax errors

2006-08-28 Thread Martin Glueck
If you run On 8/28/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > > On 8/28/06, Ilia Kantor <[EMAIL PROTECTED]> wrote: > > > > > > When I have syntax error in python code of an app, where it goes ? > > > > I'm working under apache, same config as production, but > > MaxRequestsPerChild 1 > > > > Th

Re: Having trouble with views

2006-08-01 Thread Martin Glueck
Hi, > NameError at /portfolio/3d/ > global name 'object_detail' is not defined > > Exception Location: /myproject/portfolio/views.py in category_view, > line 10 That normally mean that you have not imported the name. Do you have something like this in you views.py from django.views.generic

Re: Having trouble with views

2006-08-01 Thread Martin Glueck
Hi, >[...]#Views > def category_view(request, cat_slug): > [...] > (r'^portfolio/(?P[-\w]+)/$', > 'myproject.portfolio.views.category_view'), > > When I try "mydomain.com/portfolio/category_slug" (My category_slug is > "3d") I get the error: > > TypeError at /portfolio/3d/ > category_view(

Re: __str__ concatenation

2006-07-27 Thread Martin Glueck
Seth, the python magic "__str__" function shoud return a string but in your example you returned a tuple consisting of 3 strings. > def __str__(self): > return self.program, " ", self.course_number To return the correct string you should change your code to either: def __str__

Re: Strings as filter args

2006-07-27 Thread Martin Glueck
Chase, > I'm trying to dynamically generate filter kwargs (in the form of > strings) and feed them to a QuerySet, but the queryset wants nothing to > do with it. Here's some simplified code: > > name = "joe-smith" > string = "person__slug__exact" > string += "=" + name > > qs = Person.objects.fil

Re: unbuffered output to client/end-user

2006-07-16 Thread Martin Glueck
Sorry Nick, but the comment about the database access wasn't mine.. so I cannot help you here Martin On 7/16/06, Nick <[EMAIL PROTECTED]> wrote: > Martin, > > You mean if I access the model? I tried looking up a close() method for the > DB api but couldn't find anything. > Could you be more

Re: unbuffered output to client/end-user

2006-07-15 Thread Martin Glueck
Nick, > Cool, this actually works with yielding, thank you very much. > Glad that it worked (I didn't try it out) > You don't seem to be THAT new too django:) > I am. Just started a few days ago. But since I had to find a way how to use Django with a normal CGI interface I had to dig into t

Re: unbuffered output to client/end-user

2006-07-15 Thread Martin Glueck
Nick, I'm new to Django so if I'm wrong here, I hope that somebody will correct me. > I'm wondering, is it possible in django to write out data to the client > (maybe via HttpResponse?) in an ubuffered way, so that you feed the data as > it comes in django to the end user. I figured it's not