Middleware Old-Style Classes

2005-10-13 Thread Andreas Stuhlmüller
Is there a reason for the middleware being old-style classes? If middleware was defined as Middleware(object) we could extend it like this without modifying Django's source: class MyCacheMiddleware(CacheMiddleware): def process_request(self, request): if check_request(request):

Re: LIST[object.attribute] lookup in template

2005-10-13 Thread Andreas Stuhlmüller
Hi Adrian, > In your case, pass ITEM_NAMES[item.type] > to the template context. Easier said than done. The template was intended to do something like this: {% for item in items %} {{ ITEM_NAMES[item.type] }} {% endfor %} Is it possible to achieve this without passing an additional item_ty

Re: Middleware Old-Style Classes

2005-10-13 Thread Sune Kirkeby
On 10/13/05, Andreas Stuhlmüller <[EMAIL PROTECTED]> wrote: > Is there a reason for the middleware being old-style classes? Speaking for my own code: No, there is no reason, I am just not in the habit of writing new-style classes. And I don't think there is a reason for the other middlewares bein

Re: Surving Static Files on Django

2005-10-13 Thread Sune Kirkeby
On 9/29/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > To pick one example: in a dynamic serving situation, KeepAlive is > your friend; [ snip a lot ] Hmmm... HTTP Keep-Alive? Then either I'm misunderstanding you, or everything you say is exactly opposite to what I remember reading elsewhere

Re: LIST[object.attribute] lookup in template

2005-10-13 Thread Robert Wittams
Andreas Stuhlmüller wrote: > Hi Adrian, > > >>In your case, pass ITEM_NAMES[item.type] >>to the template context. > > > Easier said than done. The template was intended to do something like > this: > > {% for item in items %} > {{ ITEM_NAMES[item.type] }} > {% endfor %} > > Is it possibl

Re: Surving Static Files on Django

2005-10-13 Thread Jacob Kaplan-Moss
On Oct 13, 2005, at 7:15 AM, Sune Kirkeby wrote: On 9/29/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: To pick one example: in a dynamic serving situation, KeepAlive is your friend; [ snip a lot ] Hmmm... HTTP Keep-Alive? Then either I'm misunderstanding you, or everything you say is ex

Create app articles

2005-10-13 Thread Grigory Fateyev
Hello! I am writing my first app for django, areticles. All tutorials read. I want from app: - add articles by users for readding by admin and publish them or del - archive by months - insert last 5 bref_articles to index page of site Create a model from django.core import meta cla

Re: Middleware Old-Style Classes

2005-10-13 Thread Adrian Holovaty
On 10/13/05, Andreas Stuhlmüller <[EMAIL PROTECTED]> wrote: > Is there a reason for the middleware being old-style classes? If > middleware was defined as Middleware(object) we could extend it like > this without modifying Django's source: Nope, no reason. Generally throughout the Django code, we

Media Root Woes

2005-10-13 Thread jms
Hi, I have a simple problem I can't seem to sort out, I can't make use of the media root under the built in server when developing. I have done this in main.py in my project: MEDIA_ROOT = '/path/to/some/folder/www/' MEDIA_URL = 'http://localhost:8000/www/' I expected everything under the MEDIA

Manipulators that span a relationships?

2005-10-13 Thread Ian Maurer
Is there a way to create a manipulator that will span a foreign key relationship, similar to the "edit_inline" feature in the Admin tool? I know I cannot leverage the edit_inline feature now (ticket #535 may fix that) but is there a "smart" way of leveraging the validation and form processing fea

Re: Manipulators that span a relationships?

2005-10-13 Thread Robert Wittams
Ian Maurer wrote: > Is there a way to create a manipulator that will span a foreign key > relationship, similar to the "edit_inline" feature in the Admin tool? > > I know I cannot leverage the edit_inline feature now (ticket #535 may > fix that) but is there a "smart" way of leveraging the valida

Re: Manipulators that span a relationships?

2005-10-13 Thread Ian Maurer
That's a pretty slick implementation, I'd like to try it out... some questions: Is it in a usable format? Are there any directions for pulling this branch down to my local environment? What happens if the main branch gets updated? thanks... ian On 10/13/05, Robert Wittams <[EMAIL PROTECTED]>

Re: Manipulators that span a relationships?

2005-10-13 Thread Robert Wittams
Ian Maurer wrote: > That's a pretty slick implementation, I'd like to try it out... some > questions: > > Is it in a usable format? > Are there any directions for pulling this branch down to my local environment? > What happens if the main branch gets updated? > > > thanks... > ian > > > W

Re: Manipulators that span a relationships?

2005-10-13 Thread Ian Maurer
Easy enough. I will let you know if I run into any problems... thanks again, ian On 10/13/05, Robert Wittams <[EMAIL PROTECTED]> wrote: > > Ian Maurer wrote: > > That's a pretty slick implementation, I'd like to try it out... some > > questions: > > > > Is it in a usable format? > > Are there a

Re: Site-wide User Authentication

2005-10-13 Thread Andreas
Maniac wrote: > You could subclass django.core.extensions.DjangoContext and > prefill it with your everpresent variables in __init__(). I ended up subclassing "Context". I was wrong when I said writing a custom Context doesn't seem to save code -- passing MyContext(request) to render_to_response