Re: magic_removal table update

2006-01-25 Thread Andreas Stuhlmüller
On 1/25/06, Max Battcher <[EMAIL PROTECTED]> wrote: > At this point I'm a bit stumped on how to properly do this. Is there an > easy way to resync the sequences in PostgreSQL that I've overlooked? Did you try "django-admin.py sqlsequencereset"? This used to work for me. Andreas

Re: recovering from interpreter db errors

2006-01-23 Thread Andreas Stuhlmüller
On 1/23/06, Luke Skibinski Holt <[EMAIL PROTECTED]> wrote: > > Is there a way within the interpreter of recovering from these sorts of > errors: > > psycopg.ProgrammingError: ERROR: current transaction is aborted, > commands ignored until end of transaction block Execute these commands after the

Re: Posting form data across urls

2006-01-20 Thread Andreas Stuhlmüller
On 1/20/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm probably missing the point here but I'm having a problem with > posting data to other URLs I only seem to be able to access > request.POST (infact reuest.POST is only True ) when I post a form back > to itself using action="." > > If I

Re: passing additional parameters to a view

2006-01-17 Thread Andreas Stuhlmüller
On 1/17/06, patrick kranzlmüller <[EMAIL PROTECTED]> wrote: > unfortunately, it doesn´t. You're right. You have to consider that request.GET and request.POST are MultiValueDicts. If you don't expect one key to have more than one value, something like this might work: milestones_list = milesto

Re: passing additional parameters to a view

2006-01-17 Thread Andreas Stuhlmüller
On 1/17/06, patrick kranzlmüller <[EMAIL PROTECTED]> wrote: > actually, i don´t really know my query parameters. > could be responsible__id__exact=5 > or status__exact=1 > or responsible__id__exact=5&status__exact=5 > ... and so on. > > so, it´d be nice to have something like milestones_list = > m

Re: Translate db api in model

2005-12-26 Thread Andreas Stuhlmüller
> I get the following error. 'WorkOrder' object has not attribute > 'get_values'. Any ideas? Try this: def _pre_save(self): lastid = get_values(fields=['id'])[-1]['id'] self.wonum = 'WO-'+lastid+1 Andreas

Re: get_list() with foreignkey-parameters

2005-12-19 Thread Andreas Stuhlmüller
Hi Patrick, > this doesn´t: > milestone_list = milestones.get_list(responsible__exact=1, > order_by=['-id']) Try this: milestone_list = milestones.get_list(responsible__id__exact=1, order_by=['-id']) "1" is the user's id, so this should work: milestone_list = milestones.get_list(responsible__i

Re: _pre_save and _post_save for "set_thingie" methods

2005-11-24 Thread Andreas Stuhlmüller
On 11/25/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > Would it work for you to put the pre- and post-saving logic in your > own code, or does it absolutely have to be part of Django itself? It would make things a lot easier if it was part of Django, but it doesn't necessarily have to be part

_pre_save and _post_save for "set_thingie" methods

2005-11-24 Thread Andreas Stuhlmüller
It looks like "set_thingie" methods for many-to-many related objects (as well as "set_thingie_order" and "get_thingie_order" methods) don't trigger _pre_save or _post_save. Of course that's how it should be -- but is there a recommended way to execute code before or after these methods? Andreas

Re: Handling large applications

2005-11-19 Thread Andreas Stuhlmüller
Adrian Holovaty wrote: > * All the model modules have to live *directly* within the models > directory -- so the multi-level example you gave wouldn't work. Thanks, that's what I wanted to know. Multi-level models would have been nice, but judging from the open tickets there are much more importa

Handling large applications

2005-11-19 Thread Andreas Stuhlmüller
Are there any guidelines for managing large applications with Django? Most of the time it is possible to split those into several smaller apps, but sometimes it isn't - what is the recommended way to handle large apps? For example, does Django support splitting the models file into several package

Re: HTTP_REFERER

2005-11-05 Thread Andreas Stuhlmüller
PythonistL wrote: > Can anybody explain WHY the value from GET part > (command on line 15 such as > Refferer1= request.META['HTTP_REFERER'] > ) is not saved to POST? request.POST contains only the variables POSTed by the user. You'll have to make sure that the referer variable is part of your for

Re: Problems configuring urls.py to respond to /

2005-10-26 Thread Andreas Stuhlmüller
Hi Clint, > How would I set up my urls.py to redirect people who attempt to access the > root URL of the site, (ie. http://mydomain.com/) to the application I want > people to use (ie. http://mydomain.com/myapp/) The regex that catches the root URL is ^/?$ (r'^/?$' in urls.py). In order to redir

Re: Pb with Backwards-incompatible admin changes

2005-10-20 Thread Andreas Stuhlmüller
Hi Laurent, > Error: The database couldn't be initialized. > 'module' object has no attribute 'INSTALLED_APPS' Deleting your project/settings directory might help. At least it helped when I got this error :). Andreas

When to cache

2005-10-18 Thread Andreas Stuhlmüller
At http://code.djangoproject.com/ticket/603 Jacob wrote: "Yes, actually -- turns out that the cost of a cache miss is *more* than the cost of compiling a template (we profiled this about a year ago, so it may have changed in the meantime). So it turns out it's easier to just parse the template wh

Dynamic limit_choices_to for non-admin views

2005-10-16 Thread Andreas Stuhlmüller
Is it possible to use a kind of limit_choices_to attribute for non-admin views to select which data is shown in select boxes? For example, in a edit-this-object form that allows the user to choose a related object from a select box, I'd like to show each user only the objects she created. What's

Re: LIST[object.attribute] lookup in template

2005-10-14 Thread Andreas Stuhlmüller
Robert Wittams wrote: > I can't really work this out without more information. Could you file a > ticket with a minimal example. ( or at least include a backtrace. ) I didn't expect you to solve the problem. I just wanted to make sure that template_decorators.py doesn't depend on other new-admin

Re: LIST[object.attribute] lookup in template

2005-10-14 Thread Andreas Stuhlmüller
Robert Wittams wrote: > Alternatively, the easy way to do this would be to use > template_decorators.py from the new-admin branch The simple tag decorator looks like an extremely useful enhancement. At the moment I'm not ready to completely switch over to the new-admin branch -- is it possible to

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

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):