problem with dates when using django and postgres

2005-09-20 Thread scottpierce
sql_queries shows a query like this: SELECT assignments_assignments.id,assignments_assignments.teacher_id,assignments_assignments.student_id,assignments_assignments.subject_id,assignments_assignments.assignment_title,assignments_assignments.assignment,assignments_assignments.date_assigned,assignme

Re: problem with dates when using django and postgres

2005-09-20 Thread scottpierce
To narrow the issue a bit, I am attempting this in extra_lookup_kwargs: 'extra_lookup_kwargs': {'complete__exact':False, 'grade__isnull':True, 'due_date__lt': meta.LazyDate()} So perhaps I am not doing something right with meta.LazyData()? Scott

Re: problem with dates when using django and postgres

2005-09-20 Thread scottpierce
Uhh, I meant wrong above. been a late night. turns out it doesn't matter whether it is LazyDate or not.

selecting specific fields

2005-09-20 Thread Kenneth Gonsalves
hi, how do i select specific fields from a table? table: name - varchar, address - varchar, zip - varchar i want the equivalent of: 'select name, address from table' -- regards kg http://www.livejournal.com/users/lawgon tally ho! http://avsap.org.in ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!

Design Advice: "here" in Navigation

2005-09-20 Thread [EMAIL PROTECTED]
I often have CSS designs that call for a tab, link, button, etc; to be highlighted in some way (usually by having a different class attribute) from the other links when the user is on the page the navigation element links to. This is a PITA to build. Anyone have some good suggestions? I'm even th

Re: selecting specific fields

2005-09-20 Thread Jacob Kaplan-Moss
On Sep 20, 2005, at 6:37 AM, Kenneth Gonsalves wrote: how do i select specific fields from a table? table: name - varchar, address - varchar, zip - varchar i want the equivalent of: 'select name, address from table' The function you're looking for is ``get_values``:: >>> from django.

Modelling ordered lists of multi-type objects

2005-09-20 Thread Andreas
I am trying to build a relationship between models that is equivalent to the relationship between ordered lists of parents (mothers and fathers) and the objects 'mother' and 'father'. An example of the data I'd like to represent looks like this: list1 1. mother1 2. mother2 3. father1

Re: problem with dates when using django and postgres

2005-09-20 Thread Adrian Holovaty
On 9/20/05, scottpierce <[EMAIL PROTECTED]> wrote: > sql_queries shows a query like this: > SELECT assignments_assignments.id,assignments_assignments.teacher_id,assignments_assignments.student_id,assignments_assignments.subject_id,assignments_assignments.assignment_title,assignments_assignments.as

Re: Design Advice: "here" in Navigation

2005-09-20 Thread Adrian Holovaty
On 9/20/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I often have CSS designs that call for a tab, link, button, etc; to be > highlighted in some way (usually by having a different class attribute) > from the other links when the user is on the page the navigation > element links to. > > Th

Re: Design Advice: "here" in Navigation

2005-09-20 Thread [EMAIL PROTECTED]
In a template tag, can I get request.path from the context object? Since I'm going to use this everywhere, I don't want to put the code is a custom view. Thanks, A.

Re: Design Advice: "here" in Navigation

2005-09-20 Thread Simon Willison
On 20 Sep 2005, at 05:00, [EMAIL PROTECTED] wrote: I often have CSS designs that call for a tab, link, button, etc; to be highlighted in some way (usually by having a different class attribute) from the other links when the user is on the page the navigation element links to. This is a PIT

Re: Design Advice: "here" in Navigation

2005-09-20 Thread Jacob Kaplan-Moss
On Sep 20, 2005, at 8:31 AM, [EMAIL PROTECTED] wrote: In a template tag, can I get request.path from the context object? Since I'm going to use this everywhere, I don't want to put the code is a custom view. No, template tags do not have access to the request object (because you might be

Re: problem with dates when using django and postgres

2005-09-20 Thread scottpierce
Sorry, I tried to delete this message as it was one of those 4AM falling asleep face plowed into the keyboard kind of post. I figured out what was up at about the time the sun came up. It was of course me. Scott

Re: Design Advice: "here" in Navigation

2005-09-20 Thread [EMAIL PROTECTED]
Jacob Kaplan-Moss wrote: > On Sep 20, 2005, at 8:31 AM, [EMAIL PROTECTED] wrote: > > In a template tag, can I get request.path from the context object? > > Since I'm going to use this everywhere, I don't want to put the > > code is > > a custom view. > > No, template tags do not have access to th

Re: Table-less model as base class?

2005-09-20 Thread Eric Walstad
Hi Alberto, When I tried this, it didn't work. The classes defined in the other module were subclasses of meta.Model. In other words, I want to have my base class define database fields that will be inherited by the derived classes. Can you show an example of how you made it work? Thanks, Eri

how to use flat pages ?

2005-09-20 Thread Albert Lee
I'm sorry to ask so stupid question, but I found no docs about it. I add a flat page tag in the admin page, and set its URL(same site) , but it can't visit may I need to add a url pattern to the urlpatterns ??

Re: how to use flat pages ?

2005-09-20 Thread kmh
Try adding the following to your MIDDLEWARE_CLASSES setting: 'django.middleware.common.CommonMiddleware', This middleware tries to find a flatpage for any 404. Alternatively add this catch-all url pattern at the end of your url patterns sequence: (r'', include('django.conf.urls.flatfiles')),

Re: selecting specific fields

2005-09-20 Thread Kenneth Gonsalves
On Tuesday 20 Sep 2005 6:05 pm, Jacob Kaplan-Moss wrote: > The function you're looking for is ``get_values``:: > >      >>> from django.models.mymodule import mymodel >      >>> mymodel.get_values(fields=['name', 'address'],   > zip__startswith='660') thanks, that worked, now a new problem arises

Re: selecting specific fields

2005-09-20 Thread Jacob Kaplan-Moss
On Sep 21, 2005, at 12:36 AM, Kenneth Gonsalves wrote: thanks, that worked, now a new problem arises. how do i do a subselect to get the 'name' value of a foreign key field using get_values? http://www.djangoproject.com/documentation/db_api/#select Jacob