![]() |
|
|
|
#11 |
|
On Feb 24, 10:36*am, "Diez B. Roggisch" <de...@nospam.web.de> wrote:
> > Thanks for all your suggestions. *From what I've experienced in Django > > and now that I know a little more about how Python functions, I will > > probably use a combination of PHP and Django, instead of trying to get > > Python to do the web portion of my project. *Thanks again! > > That sounds like the worst idea. Django's ORM is good when used from > within django, because of all the additional goodies like the admin > interface. > > But if you are going to do the webfrontend using PHP, what part is left > for django? If it's only the ORM (for whatever you still use that > anyway), there are better alternatives - SQLAlchemy, and SQLObject, for > Python. They are more powerful and not interwoven with django. > > If you are going to hand-code the interface in PHP, I fail to see though > why you don't do that in Django directly. You are not forced to use the > Admin-interface. > > Diez Hello Diez, I think Django is fabulous for the admin-interface, a simple text search and template inheritance. I will use Django for all of those. What I'm not getting an answer to and cannot find an example of is a complex search, where I have to retrieve data from multiple tables, combine the data, remove the duplicates, etc between a web page and the database. The code that started this thread is only a small piece of the complex data retrieval I need to do. PHP is great for writing complex SQL queries right in the HTML template and I know exactly what it is doing. May |
|
|
|
|
#12 |
|
Posts: n/a
|
May a écrit :
> On Feb 24, 10:36 am, "Diez B. Roggisch" <de...@nospam.web.de> wrote: >>> Thanks for all your suggestions. From what I've experienced in Django >>> and now that I know a little more about how Python functions, I will >>> probably use a combination of PHP and Django, instead of trying to get >>> Python to do the web portion of my project. Thanks again! >> That sounds like the worst idea. Django's ORM is good when used from >> within django, because of all the additional goodies like the admin >> interface. >> >> But if you are going to do the webfrontend using PHP, what part is left >> for django? If it's only the ORM (for whatever you still use that >> anyway), there are better alternatives - SQLAlchemy, and SQLObject, for >> Python. They are more powerful and not interwoven with django. >> >> If you are going to hand-code the interface in PHP, I fail to see though >> why you don't do that in Django directly. You are not forced to use the >> Admin-interface. >> >> Diez > > Hello Diez, > > I think Django is fabulous for the admin-interface, a simple text > search and template inheritance. And I think you really don't get what Django is good for. > I will use Django for all of those. > What I'm not getting an answer to and cannot find an example of is a > complex search, where I have to retrieve data from multiple tables, > combine the data, remove the duplicates, etc Django's ORM is mostly a wrapper above the db-api. It's intended to make most common db access a no-brainer, not to replace full-blown SQL for complex things. Now the good news is that you *still* can drop to a lower raw-sql level - the one you'd get using either PHP or Python's db-api - for more complex things. IOW, PHP won't buy you anything here. > The code that started this thread is only a small piece > of the complex data retrieval I need to do. The "code that started this thread" is a total no-brainer using Django (as you would know by now if you had reposted your question on django's group - or even just read the FineManual, where this use case is fully documented), and doesn't even require going down to raw sql. > PHP is great for writing > complex SQL queries right in the HTML template What the .... a complex SQL query has to do in a template anyway ??? Sorry, but what you're saying here is that PHP is great for writing unmaintainable spaghetti code. FWIW, even PHP coders are trying to get out of this kind of mess nowadays. Bruno Desthuilliers |
|
|
|
#13 |
|
Posts: n/a
|
> I think Django is fabulous for the admin-interface, a simple text
> search and template inheritance. I will use Django for all of those. > What I'm not getting an answer to and cannot find an example of is a > complex search, where I have to retrieve data from multiple tables, > combine the data, remove the duplicates, etc between a web page and > the database. The code that started this thread is only a small piece > of the complex data retrieval I need to do. PHP is great for writing > complex SQL queries right in the HTML template and I know exactly what > it is doing. First of all, mixing technologies without need is most of the times a bad idea - so if it is really the case that you can't solve all of your issues in django, you shouldn't use it at all, but solve them in PHP. But to be honest - I doubt that django isn't capable of solving your problem. See http://docs.djangoproject.com/en/dev...ics-db-queries for a introduction to the multitude of query-options. I doubt that your rather simple m:n-relationship is covered there. I myself use SQLAlchemy, and that can for sure query and filter those relationships. Diez Diez B. Roggisch |
|
|
|
#14 |
|
Posts: n/a
|
> for a introduction to the multitude of query-options. I doubt that your > rather simple m:n-relationship is covered there. s/is/isn't/ Diez Diez B. Roggisch |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Prerequisites 70-745 (Business Intelligence) | Valmont | MCITP | 3 | 06-24-2008 03:03 PM |
| SQL Server 2008 delayed into Q3 2008 | darrilgibson@cox.net | MCITP | 0 | 01-27-2008 10:26 PM |
| MCITP SQL Server 2005 or SQL Server 2008 | Darrilgibson@gmail.com | MCITP | 0 | 12-19-2007 01:56 PM |
| SQL 2008 upgrade exam? | JFoushee | MCITP | 4 | 12-12-2007 12:10 AM |
| SQL Server 2005 Migration Assistant Autonumber problem. | LarryWestMCSD | MCTS | 1 | 03-28-2007 02:08 AM |