Another option, if you are using PostgreSQL or other db that supports 
VIEW's, is to store your queries as db VIEWs and then write Django 
models that reference those views.  Then you still get the yummy 
goodness of using the django dbapi to access the "objects" returned by 
your messy query/VIEW.  If your VIEW is writable, then the django 
objects will behave just like they were created from real table records. 
  If not, then you'll still have readable django objects to play with.

Eric.

Corey Oordt wrote:
> One idea is to create a package that would contain files of your  
> queries.
> 
> Each file could just be have an assignment : QUERY = """ <your query  
> here> """
> 
> You could then import them, like : from queries import update_this
> 
> and access it by update_this.QUERY
> 
> Corey
> 
> On Aug 11, 2006, at 3:05 PM, Maciej BliziƄski wrote:
> 
>> Hello Djangoers,
>>
>> I've got to write a set of large SQL queries. I'd like to avoid  
>> putting
>> the whole pages of the SQL into the Python code. I'd like to store the
>> queries as separate files and load them when needed.
>>
>> How to do in a Django way? Create something similar to template
>> directory? What would you suggest?
>>
>> Keep swingin'
>> Maciej


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

Reply via email to