Elimination of limitations of bulk_create in Django

118 views
Skip to first unread message

Elita Lobo

unread,
Feb 6, 2015, 12:39:05 AM2/6/15
to django-d...@googlegroups.com
Hello,

I am a 3rd year student of NIT Durgapur , India as well as a Gnome Developer . I have worked on many Python projects as well. I would like to start contributing to django.
Django does not allow bulk_create of objects with many_to_many field nor does it allow bulk update. Also it does not call save function which may be a bit of a problem if the save method has been overriden. I would like to work on finding a way around to eliminate these limitations.

Kindly let me know if this is feasible and if I can submit a patch for the same.
Also I would be grateful if you could point out a few bugs that could help me get started with contributing to django.


Thanking you,


regards,
Elita Lobo

Russell Keith-Magee

unread,
Feb 6, 2015, 6:20:52 PM2/6/15
to Django Developers

Hi Elita,

On Fri, Feb 6, 2015 at 1:39 PM, Elita Lobo <lobo...@gmail.com> wrote:
Hello,

I am a 3rd year student of NIT Durgapur , India as well as a Gnome Developer . I have worked on many Python projects as well. I would like to start contributing to django.
Django does not allow bulk_create of objects with many_to_many field nor does it allow bulk update. Also it does not call save function which may be a bit of a problem if the save method has been overriden. I would like to work on finding a way around to eliminate these limitations.

Kindly let me know if this is feasible and if I can submit a patch for the same.

Well, it's probably *feasible*, but not going to be *simple*. 

If you exclude many-to-many fields, bulk_create() and update() can be implemented with a single SQL call. If you allow m2m fields as well, you're going to need at *least* 1+N calls, where N is the number of m2m fields. I'm not saying it can't be done - prefetch_related has similar 1+N mechanics. However, if you're looking for a simple first issue to tackle, this probably isn't it.

Calling save() on update is a completely separate issue. Again, if you follow the mapping from Django ORM API to SQL, you'll understand why save() isn't invoked on update(), and why it would be difficult to make that change.
 
Also I would be grateful if you could point out a few bugs that could help me get started with contributing to django.

The list of all open tickets is here:


You can filter this on many different facets - e.g., a topic of interest (database backend, template system); ticket status (e.g., patch needs improvement); or, there's a flag for "easy pickings":


These are tickets that have been evaluated as "easy first tickets" by a reviewer. That doesn't necessarily mean they *will* be easy - it's possible that when you dig into the problem it will turn out to be more complex - but at least on first inspection, they should be.

If you want to get involved contributing to Django, I'd also suggest reading our contribution guide:


This fills in a lot of details about how our development process works, and has some other suggestions for how to get started contributing.

Yours,
Russ Magee %-)

Elita Lobo

unread,
Feb 7, 2015, 9:43:36 AM2/7/15
to django-d...@googlegroups.com
Hello Russell,
        Thankyou for your response. I will try to fix a few easy bugs first as you suggested and then go for adding bulk_update or improving bulk_create. 
         I am interested in doing  a gsoc project under this organization if given the opportunity. I would like to start researching and working on either template engine optimization or replacing form media class. Could you please let me know whom I need to contact to discuss about the same? Also please let me know if I need to fix some bugs to prove my capability of doing this project before taking up the same. 
I have worked on several python projects which involved django while interning in some companies. I have also done a GSOC project last year related to Gnome Calculator.



 Thanks and Regards,
  Elita Lobo
 

Tim Graham

unread,
Feb 7, 2015, 6:22:31 PM2/7/15
to django-d...@googlegroups.com
Please use this mailing list to communicate your ideas and questions regarding GSoC.

As I wrote in another thread, "Your odds of acceptance are greatly enhanced if you have a track record of producing good patches (and it will also help you write a better proposal, I think)."
Reply all
Reply to author
Forward
0 new messages