Question on multi-table inheritance docs

2009-09-08 Thread Egon Esser
Hi! Please consider http://docs.djangoproject.com/en/dev/topics/db/models/#inheritance-and-reverse-relations I'm a total failure at understanding this part: "you must specify the related_name attribute on each such field" In a Restaurant instance, wouldn't you access the Supplier instances (tha

Re: Please help optimize a query in Django 1.0

2008-09-18 Thread Egon Esser
On Sep 19, 1:33 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > What you can do is import django.db.connection.cursor (I think that's > the right location), and just execute the raw SQL. That's my prob, I wouldn't know how to build the custom SQL so as to relate to my already specific song i

Please help optimize a query in Django 1.0

2008-09-18 Thread Egon Esser
Hi all, I stole some code from this posting: http://groups.google.com/group/django-users/msg/82a9c2e94ff05188 And then I used it to calculate the rating averages of my songs like so: models.py: === class Song(models.Model): ... songrtng = models.ManyToManyField(Rating) ... c

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-09-01 Thread Egon Esser
> Now a user submits two different searches, one in each of two browser > tabs. > After that, queryset contains two dicts/pairs. > > Then the user refines the query in one of the tabs. Obviously, I want > to know which one. But I only have at most a chronology of previously > submitted searches. I

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-09-01 Thread Egon Esser
> Now a user submits two different searches, one in each of two browser > tabs. > After that, queryset contains two dicts/pairs. > > Then the user refines the query in one of the tabs. Obviously, I want > to know which one. But I only have at most a chronology of previously > submitted searches. I

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-09-01 Thread Egon Esser
> You actually wouldn't need to set up the table. The way the sessions > framework works is that it returns info already set up in the > django_session. All you have to do is call some code that looks > something like this to save the session info: > > ifrequest.session['querysets']: >request.

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-08-31 Thread Egon Esser
> First off, the server keeps session data, not the browser, Ah, great, learned something new! > but I understand what you're talking about. There's no real way without > extra programming to handle that, but here's a scheme that should be > fairly minimal: > > (1) On the "Search Results" page,

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-08-31 Thread Egon Esser
> First off, the server keeps session data, not the browser, Ah, great, learned something new! > but I understand what you're talking about. There's no real way without > extra programming to handle that, but here's a scheme that should be > fairly minimal: > > (1) On the "Search Results" page,

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-08-31 Thread Egon Esser
> When the user enterssearchtermsand submits the form it doesn't pass > a queryset object to the view. Your view gets called (with a GET or > POST) and gets passed in arequestobject. You grab the parameters > out of that (preferably using the spiffy Django forms to help you > handle validation)

How to pass queryset to the next request (e.g., search term refinement)?

2008-08-29 Thread Egon Esser
Hi there, as far as I understood and until now needed to know, Django works for me like this: Human enters url into browser -> urls.py -> views.py -> template In the template, I could dynamically generate a url which matches in another urls.py somewhere, and that closes the circle. Now imagine

Re: vanilla login_required decorator not strict enough to rely on?

2008-07-16 Thread Egon Esser
Right now I'd just like to know if there is anyone at all anymore that wrote a custom/extended login_required decorator and what type of extension and the exact need for it (motivation) was. Thx, folks! --~--~-~--~~~---~--~~ You received this message because you ar

vanilla login_required decorator not strict enough to rely on?

2008-07-09 Thread Egon Esser
Hi all, I have spent some weeks on Django in my spare time now. In the docs and in most of the code (examples) I have seen, relying solely on request.user.is_authenticated seems to be the word. However, lately this once happened onto me: I logged a user out of my site and for testing purposes,

django vs mod_python's handlers

2008-04-16 Thread Egon Esser
Hi all, I am on the way to install django on apache2/mod_python with MySQL. Right now, though, I feel a bit like an idiot, cause I could not find any documentation or discussion on the internet that would give me an overview on how the things below relate to one another. It seems I still need to