On Fri, 2008-09-05 at 09:28 -0700, Krommenaas wrote: > Hi, > > I've used Ruby on Rails and CakePHP and am considering using Django > for my next site coz I'm intrigued by Python. I have a few questions > that I couldn't find the answer to in the docs: > > 1) Does your webhost need to support Django specifically or is it > sufficient if they support Python? (e.g. with CakePHP you just need > general PHP support).
Just Python will be enough. You can have a copy of Django in any directory, providing the webserver can be configured to find it, which is normally very easy. > > 2) I want to use raw sql for all my select queries (to have 100% > control and because I don't see the point of learning another query > language - I do like ORM to insert/update records from a form). Can I > use multiline strings? Not sure because of the python empty space > thing, and the examples in the documentation are all on one line. E.g. > in PHP I do something like the following, which I can copy/paste > straight into my db tools. > > $qry = " > SELECT * > FROM table1 > LEFT JOIN table2 ON ... > WHERE ... > ORDER BY > LIMIT > " You aren't really asking a question about Django here, since it you're wanting to write raw SQL, you're saying "I don't want to use Django for that". Django provides a way to have access to the direct database cursor, but at that point Django isn't involved any longer. So the question is whether or not the Python database wrapper for the database you're using allows this. I believe the answer is "it varies", but generally the answer will be "no". The best way to work out the answer to this for whichever database you're wanting to use is to try it and see. > 3) Would django return the results of a query like this line by line, > or does it process it. In Cake the fields from table1 and table2 get > put in separate sub-arrays, which I like. You should probably work through the tutorial to see how it works in Django. You won't see "rows" from the database. Django is designed to be a Python framework, so you work with Python objects. It happens to use an SQL database for persistent storage, but that's almost totally abstracted away. > > 4) I read somewhere in the documentation that you can use other > templating systems than Django's own. Is it also possible to just use > Python inside the views? If you use an appropriate templating language that supports that, yes. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---

