473,804 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Django Vs Rails

Firstly, this topic is NOT intended for trolling or starting any flame
wars.

I want to know if anyone has experience with these frameworks, and if
so, how do they compare? Which one do you prefer?

Going back to school in a few days, I simply don't have the time to try
both.

-thanks
http://djangoproject.com
http://rubyonrails.com

Sep 6 '05
28 5498
James wrote:
I actually like the framework to reflect on my database. I am more of a
visual person. I have tools for all my favorite databases that allow me
to get a glance of ER diagrams and I would rather develop my data
models in these tools rather than in code. Further more I rather like
the idea of parsimonious use of code (which is probably why I use
Python in the first place) and do not really like manually specifying
data schemas in code as much as possible.

Is some familiar with a Python Framework that builds by reflection.


PyDO (http://skunkweb.sourceforge.net/pydo2.html) is a Python ORM tool
that does this well (*cough* better than sqlobject *cough*).

-Jonathan

Sep 15 '05 #21
On 2005-09-15, Jonathan Ellis <jb*****@gmail. com> wrote:
James wrote:
I actually like the framework to reflect on my database. I am more of a
visual person. I have tools for all my favorite databases that allow me
to get a glance of ER diagrams and I would rather develop my data
models in these tools rather than in code. Further more I rather like
the idea of parsimonious use of code (which is probably why I use
Python in the first place) and do not really like manually specifying
data schemas in code as much as possible.

Is some familiar with a Python Framework that builds by reflection.


PyDO (http://skunkweb.sourceforge.net/pydo2.html) is a Python ORM tool
that does this well (*cough* better than sqlobject *cough*).


As the current PyDO dev, I won't make the same comparative value
judgement as Jonathan here, not out of reticence, but lack of
conviction -- SQLObject is quite excellent, and for all I know better
than PyDO in execution -- but a comparison I would make is that PyDO
is different from ORMs like SQLObject (and even more so, from
ActiveRecord) in that it assumes that the database precedes the object
layer, chronologically and/or in significance, and that the database
schema shouldn't need to conform much to a particular ORM's
expectations, reasonable as they may or not be. The most obvious
differences are that SQLObject expects tables to have an "id" integer
column, and doesn't support multi-column candidate keys; PyDO doesn't
make such demands. So, similar as they are, in orientation these
libraries are somewhat different beasts.

I have mixed feelings about automagical schema introspection. PyDO
supports it, and will probably do so increasingly robustly if people
use it. But part of me feels that "explicit is better than implicit"
may win out over DRY here, because the ORM layer and the db layer
exist in different realms, and if the ORM layer adapts silently to
changes in the db layer, other code is likely to fail in unpredictable
ways, including silently, whereas an explicit declaration of what
fields are in a table, for instance, will fail with a hard error. But
maybe this is anal retentiveness, akin to a need for strong typing.

js
--
Jacob Smullyan
Sep 15 '05 #22
Jacob Smullyan <sm******@smull yan.org> writes:
I have mixed feelings about automagical schema introspection. PyDO
supports it, and will probably do so increasingly robustly if people
use it. But part of me feels that "explicit is better than implicit"
may win out over DRY here, because the ORM layer and the db layer
exist in different realms, and if the ORM layer adapts silently to
changes in the db layer, other code is likely to fail in unpredictable
ways, including silently, whereas an explicit declaration of what
fields are in a table, for instance, will fail with a hard error. But
maybe this is anal retentiveness, akin to a need for strong typing.


I just wonder when it becomes bad having to declare everything. For example,
we have databases with 600 tables. Declaring them all again will make a huge
PITA and would not be very helpful, specially because there's already some
declarations at the ER diagrams, at the SQL script, inside the database, and
then again at each and every python class?

Having the introspection is great in this case (even though it is boring
having to declare all those classes and tell them to fetch their structure
from the database it is better than having to "recreate" all of them).

With regards to failures, this is one of the reasons for unit tests :-) They
can help finding out where is the problem and they should never fail
silently.

--
Jorge Godoy <go***@ieee.org >
Sep 15 '05 #23
On 2005-09-15, Jorge Godoy <go***@ieee.org > wrote:
I just wonder when it becomes bad having to declare everything. For example,
we have databases with 600 tables. [snip] Having the introspection is great in this case (even though it is boring
having to declare all those classes and tell them to fetch their structure
from the database it is better than having to "recreate" all of them).
Granted. Also, if the tables share structure, another option would be
to simplify their description with inheritance.
With regards to failures, this is one of the reasons for unit tests :-) They
can help finding out where is the problem and they should never fail
silently.


You are right. I am consoled.

js

--
Jacob Smullyan
Sep 15 '05 #24
Jacob Smullyan <sm******@smull yan.org> writes:
Granted. Also, if the tables share structure, another option would be
to simplify their description with inheritance.


It would be great if relationships could be mapped this way too. Something
like ...

=============== =============== =============== =============== =============== =====
class Person(baseclas sForORM):
pk_person = PK() # Dunno, it could be anything...
name = String(40)
birth_date = Date()
sex = String(1)
obs = Text()
Address(basecla ssForORM):
pk_address = PK() # Dunno, it could be anything...
person_pk = Person(pk_perso n) or None # If it can be null...
city = String(30)
state = String(30)
(...)

inhabitant = ''
if (addressInstanc e.person_pk):
inhabitant = address.name

(...)

=============== =============== =============== =============== =============== =====

(this is a *very bad* example, I just couldn't think of
something simple and better right now)

.... would also be interesting but it isn't essential. I believe it is simpler
than inheritance for the ORM tool. Just making it easy to retrieve records
from a related "class" would be great. This is one thing that I like with
SQLObject -- I have never used PyDO, but I'll give it a try -- and getters and
setters :-)

When you go to the field of ORDBMS, it gets even more complicated, since you
can have inheritance on the database side as well...
Ah! Of course one should not forget of mapping views as well. :-) Having
some way to create logic to update the view is nice if the selected database
doesn't support it (e.g. with rules when using PostgreSQL).
But then, I'm far out of Python with this message :-) Sorry.

--
Jorge Godoy <go***@ieee.org >
Sep 15 '05 #25
I'm a python guy, so I haven't tried rails myself (I did read the
tutorial though). I tried Django and didn't like it somewhat. One thing
I don't like about it is that you have to write the same things twice,
for ex. specify url resolver and reference it in config. Django is not
bad but not spectacular either. http://www.turbogears.org/ on the other
hand is! I had no CherryPy or SQLObject experience before, but I learnt
the framework and implemented my first web-app with it in one day time!
That includes the model, some views and an xml-rpc control interface.
That's outstanding productivity if you ask me.

You should give TurboGears a try.

Sep 25 '05 #26
Dnia 24 Sep 2005 22:48:40 -0700, ma****@gmail.co m napisa³(a):
You should give TurboGears a try.


http://www.turbogears.org/about/status.html

"TurboGears should be considered *alpha* software. This means that there
can be *breaking API* changes between now and 1.0." It uses CherryPy
(beta!), SQLObject (beta) and Kid (which has a couple of bugs that need
fixing) This project is good only for fun and playing not for enterprise.

--
JZ
Sep 25 '05 #27
D H
Jaroslaw Zabiello wrote:
Dnia 24 Sep 2005 22:48:40 -0700, ma****@gmail.co m napisa³(a):

You should give TurboGears a try.


....This project is good only for fun and playing not for enterprise.


That's my kind of project :)
Sep 25 '05 #28
If you are looking for something pythonic, full featured and very easy
to use, you should check this out: http://karrigell.sourceforge.net

Give it a try and let me know how it goes...

Cheers,
Luis

Sep 26 '05 #29

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1555
by: JZ | last post by:
http://www.djangoproject.com/ -- JZ
92
4422
by: Ray | last post by:
I just moved to another company that's mainly a Java/.NET shop. I was happy to find out that there's a movement from the grassroot to try to convince the boss to use a dynamic language for our development! Two of the senior developers, however, are already rooting for Ruby on Rails--although they haven't tried RoR themselves. When I suggested Django, they went like, "what's that?". I said, "It's like the Python counterpart of RoR".
2
2340
by: cuongvt | last post by:
Hello I'm new to both Django and Python. I'm mainly developing on PHP. I tend to move to Django. But I want to confirm as below: I heard that Django is mainly used for something like content management, CMS or something like that and Rails is mainly for web applications. So my question: is it true or not? For rapid web application development, can I use Django to create intranet database web driven application in my company for example:...
1
5963
by: Aspersieman | last post by:
On Wed, 05 Nov 2008 08:35:23 +0200, 3000 billg <billg3000@hos.twgg.org> wrote: Hi Excellent choice :)
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10097
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9175
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.