Re: A proposal for a new auto-reloader in Django

2017-03-30 Thread Aymeric Augustin
Hello, > On 29 Mar 2017, at 01:05, qingnian...@gmail.com wrote: > > the best library to replace Watchdog is Watchman, a library that supports > both of these three platforms (for Windows it's still in the alpha stage.) Django currently doesn't use Watchdog. Watchdog is a cross-platform Python

Re: A proposal for a new auto-reloader in Django

2017-03-30 Thread Carl Meyer
Anyone working on this project should at least be aware of https://github.com/Pylons/hupper (based on work David Glick and I originally did in https://github.com/carljm/wsgiwatcher), which aims to be a framework-agnostic solution to this problem for any Python web project. Docs at http://docs.pylon

Adding signals to bulk update/create operations

2017-03-30 Thread Todor Velichkov
Consider the following piece of code: @receiver(pre_save, sender=MyModel) def my_handler(sender, **kwargs): instance = kwargs['instance'] if instance.verified: do_something(instance) else: do_else(instance) Its good, because it keeps `MyModel` decoupled from `do_some

Add better support for ManyToMany with intermediary table fields, and reverse relationships, specially in forms

2017-03-30 Thread Gabriel Canto
When you are creating a system from scratch, coming with a ideal and organized model is simple enough, but when you are trying to replicate a real world system/issue into your models, things get complicated. By complicated I mean, almost every relationship is a M2M with intermediary fields, tha

Re: Adding signals to bulk update/create operations

2017-03-30 Thread Tim Graham
There's an accepted ticket about adding pre_update and post_update signals: https://code.djangoproject.com/ticket/21461. From a quick glance, I think this is what you're proposing. On Thursday, March 30, 2017 at 4:28:00 PM UTC-4, Todor Velichkov wrote: > > Consider the following piece of code: >

Re: Add better support for ManyToMany with intermediary table fields, and reverse relationships, specially in forms

2017-03-30 Thread Collin Anderson
Hi Gabriel, Yes, the hope is to make the situation better and more standard. Here's some of the status: https://code.djangoproject.com/ticket/24317 - real reverse fields. https://code.djangoproject.com/ticket/897 - real reverse many to many fields https://code.djangoproject.com/ticket/12203 - many

Re: Adding signals to bulk update/create operations

2017-03-30 Thread Anssi Kääriäinen
The problem with passing the queryset is that it's possible that some object is added to or removed from the queryset between the pre_update and actual update execution. To avoid this the execution should go somewhere along the lines of: 1) if there is pre_update or post_update do stages 2-5,

Re: A proposal for a new auto-reloader in Django

2017-03-30 Thread qingnian213
Hi Carl, Thanks for mentioning this awesome project! I saw it in one of the discussions but did not take a close look. I'll definitely check this out and try to integrate wsgiwatcher/watcher.py into Django. On Thursday, March 30, 2017 at 7:47:13 AM UTC-7, Carl Meyer wrote: > > Anyone working o

Re: A proposal for a new auto-reloader in Django

2017-03-30 Thread qingnian213
Hi Brice, Thanks for the suggestion! I'm not sure whether if I can successfully implement a library like you've mentioned, so for now I might stick with the Watch* libraries available. I really love the goals you've listed and would add these to my proposal. David Ma On Thursday, March 30, 2