Hey Rory... On Monday 04 September 2006 17:03, Rory Campbell-Lange wrote: > I'd be hugely grateful for advice on how suited Django might be to > integrating with custom-written pl/pgsql queries, stuff that running the > Django test tutorial does not answer. I imagine mapping python objects > to pl/pgsql functions by hand yet benefit from URL mapping, cookie > handling/session management (like PHP) and easy templating. I guess it > is fair to say we would wish to discard the standard ORM mappings. > > Is this doable? Short answer: Yes.
You are not tied to using the Django orm. I often find myself working directly with psycopg for some SQL that is easier for me to comprehend with plain, non-djangofied, SQL. Take your favorite "Hello World" example of psycopg code and stick it in a Django view and it'll work. My colleague, on the other hand, prefers Django's ORM and is often teaching me cool ways to use it in intuitive ways. My advice here is to not rule out using Django's ORM entirely, but be comforted by the fact that you are in no way required to use it. Also, I like to use PostgreSQL's views to store often used, complex, queries. I can then use Django's ORM to access those views just like any other db table, the caveat being that if the view is read-only, then the Djangofied ORM object will be, too. A final note is that, from one developer to another, using Django is fun. For the most part, I write Python code in my Django apps that I expect to work and it usually does. Django is transparent in this way. If there's a Python library I need, I can use it. Django is python - import what you like, do what you like. Good luck, have fun, Eric. -- _________________________ Eric Walstad 740 Clementina Street San Francisco, CA 94103 415-864-4224 voice & fax [EMAIL PROTECTED] _________________________ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---