NAA> On 7/25/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote:
 >> Yes, I read carefuly your question and thought the answer was
 >> straighforward.   I don't understand why you don't want decorators, but you
 >> could just check the decorator definition to read what it does and copy
 >> it's code.  All you need is decorator name and grep over django sources :)

 NAA> Aren't decorators usable only in views? 

Decorators are python feature.  Django views are regular functions, just as
any other.

 NAA> At least that's what I think.  I have a project that required a
 NAA> separately running process (running as daemon) that needed access to
 NAA> the Django models. Since the code in the daemon is not run in the
 NAA> context of a view (no triggering of TransactionMiddleware),
 NAA> transactions decorators do not work. I get:

 NAA> TransactionManagementError: This code isn't under transaction management

Not having read transaction code, can't say what haven't worked in your
case.  Definitely, something wasn't initialized :)

-- 
Andrey V Khavryuchenko            
Django NewGate -  http://www.kds.com.ua/djiggit/
Development - http://www.kds.com.ua 
Call akhavr1975 on www.gizmoproject.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to