Ivan Illarionov napisał(a):

> You may add this code to your Django model class and then instead of
> obj = YourModelClass(title='Title', ....,
> pub_date=datetime.datetime.now() )
> use
> row = (None, 'Title',..., datetime.datetime.now())
> obj = YourModelClass.fromtuple(row) # 1.3x faster then before
> or
> obj = YourModelClass.fromtuple(row, False) # 3x faster then before
> only if you don't need pre_init and post_init signals!
> 
> The number of tuple items should be exactly the same that number of
> fields.

And exactly in the same order they appear in instance._meta.fields...

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to