remove references

2008-06-13 Thread Constantin Christmann
Hello, how can I achieve that a custom function (maybe in my model class) gets called if a model becomes deleted? What I want to do is to ensure that all references to a model are removed when it woun't exist any longer in the database. Is that possible? Regards, Constantin

Re: middleware irritation

2008-06-06 Thread Constantin Christmann
process_response. Constantin Christmann schrieb: > Hello, > > lately I installed a middleware to track user activity on my website > (mainly code from this blog post > http://whijo.net/blog/brad/2007/07/19/statistics-logging-django.html) > > I use the following middleware classes:

middleware irritation

2008-06-05 Thread Constantin Christmann
Hello, lately I installed a middleware to track user activity on my website (mainly code from this blog post http://whijo.net/blog/brad/2007/07/19/statistics-logging-django.html) I use the following middleware classes: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware',

Newform help

2008-04-30 Thread Constantin Christmann
Hello, can someone tell me, how I display only the errors that are _not_ specific to one field of a newform. What I mean is the following: I have two password field which should match. I check that in clean() and throw a ValidationError. But how can I access this comprehensive error message

define special attributes with ModelForm

2008-04-18 Thread Constantin Christmann
Hello, I am using ModelForm for auto-generation of my input forms. It saves me much time to use this, but is there a way to apply additional attributes to the generated form. I mean the kind of attributes I can define with attrs={'class':'special'} in the newforms library. Regards,

Re: New db connection within a view

2008-04-03 Thread Constantin Christmann
Hi again :) that sounds promising! I will definitively look into that!! Karen Tracey schrieb: On Thu, Apr 3, 2008 at 9:47 AM, Constantin Christmann <[EMAIL PROTECTED]> wrote: Hello, I am working on the following problem now since yesterday and have no idea what

Re: sql & cache problem? Am I crazy?

2008-04-03 Thread Constantin Christmann
Hi Sandro, this is indeed a caching issue. But I guess this is more of a feature that a bug, because with caching enabled you keep an old page some time until it's expired. Adjacent request get this old page stored in the cache which decreases server and database load. If you bypass this

Re: TransactionMiddleware

2008-04-03 Thread Constantin Christmann
ction within a view" Regards, Constantin Karen Tracey schrieb: On Thu, Apr 3, 2008 at 4:58 AM, Constantin Christmann <[EMAIL PROTECTED]> wrote: Hope someone can help me out here: I am using TransactionMiddleware, are raw SQL queries inside a view part of the views transaction?

New db connection within a view

2008-04-03 Thread Constantin Christmann
Hello, I am working on the following problem now since yesterday and have no idea what could be the reason for this behavoir: Inside my view (I have TransactionMiddleware enabled) I execute some raw SQL (UPDATE) and afterwards I save form data to the database. With postgres this works fine

TransactionMiddleware

2008-04-03 Thread Constantin Christmann
Hope someone can help me out here: I am using TransactionMiddleware, are raw SQL queries inside a view part of the views transaction? Thanks, Constantin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Combine raw SQL with model.save() in one transaction?

2008-04-02 Thread Constantin Christmann
Is it possible to combine raw SQL statements with Django's convenient model.save() in one transaction? I use MySQL/InnoDB and need to place some raw SQL inside a transaction block: cursor = connection.cursor() cursor.execute(""" START

Re: dictionary rows form database

2008-04-02 Thread Constantin Christmann
Malcolm Tredinnick schrieb: > Wouldn't it be better to ask this question on the psycopg2 mailing list? > Sorry, it's not my intention to misuse this mailing list and I did ask this question to myself before posting. I am trying to keep the django code db-backend independend (which is part of

dictionary rows form database

2008-04-02 Thread Constantin Christmann
Hello, I am trying to get a sequence of dictionaries instead of a sequence of tuples from cursor.fetchall() When googleing I found some examples doing this by c = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) c.fetchall() But when looking at the source of the psychopg2

fetchall question

2008-04-01 Thread Constantin Christmann
Hello, On my localhost with Postgres cursor.fetchall() returns a list of tuples (one list element per row). And on the production server with MySQL a tuple of tuples... How can that be... is there perhaps an inconsistency in the db interface? Thanks, Constantin

caching question

2008-03-31 Thread Constantin Christmann
Hello Django-Group, I have a caching related question: The website I am currently working on has a header where the login status of the current user is displayed. I am thinking about ways for caching such a site: because of the displayed login status caching on a per view basis would require a

Re: generating json?

2008-03-24 Thread Constantin Christmann
Thanks Michael for you sugestions, I'll look into that! Michael schrieb: Now I am curious if there is also a build-in functionality that objects become serialized into json by automatically calling a __json__ function on the object?? When looking at the docs simplejson throws an

Caching question

2008-02-25 Thread Constantin Christmann
Hello, I installed the CacheMiddelware with the following settings: CACHE_BACKEND = 'db://cache_table' CACHE_MIDDLEWARE_SECONDS = 300 CACHE_MIDDLEWARE_KEY_PREFIX = '' CACHE_MIDDLEWARE_ANONYMOUS_ONLY = False For testing I print the creation time of the rendered view in the corner of my website.