All hail, Django models. 14
I have been spending a lot of time writing Django code (as you have probably noticed).
In the past, I have been quite derisory about Django, there are many things that I don't like.
Djangos ORM is NOT one of the problems. Well, fundamentally, it isn't. On the surface it stinks.
So, lets get the nasty out of the way first.
Some examples.
In Rails, how do I find a particular instance if I know the ID?
instance = Model.find(123)
in Django
instance = Model.objects.get(pk=123)
Thats UGLY.
This whole idea of managers, is a nice idea, but it is not entirely pretty.
Now for the good thing.
in Ruby if you do...
object_list = Model.find(:all)
you will get a big array filled with instances of all the objects in the database. Needless to say, this can SWALLOW your system. So,
you have to be careful with AcriveRecord::Base, you get what you ask for, and if you ask for the moon, your system will fall to
its knees and die.
in Django if you do....
object_list = Model.objects.all()
You will get an object that pretends to be an array, and only when you access chunks of it will it actually go over to the DB and
pull back the required information. Thats NICE. BUT, it means you have to be a bit more careful, as it lulls you into a false sense
of security. You have to remember that if you DO ask for the list of objects, you WILL get them. So, you have to remember.
In rails, you know up front that you have to be careful, so its not quite as nice, but you aren't coddled.
So, I do like Django models, it works in a more scalable fashion than Rails' ActiveRecord:Base.
This leads me down the road of drawing comparisons between Ruby and Python. But thats the subject of a whole nother post.
5MTXt5 sjfcdrywdvqw, [url=http://bblsaslrkwsj.com/]bblsaslrkwsj[/url], [link=http://autzxuektjpc.com/]autzxuektjpc[/link], http://bwaxjxanjwhz.com/
SG8rpO zjrniniyjdhd, [url=http://kollzgxytsfx.com/]kollzgxytsfx[/url], [link=http://nwceyjslfzsb.com/]nwceyjslfzsb[/link], http://fcepnswynadv.com/
comment6, generic medication for advair, buy plavix, effexor, acomplia, doxycycline,