Re: Make ManyToMany fields support "to_field".

2016-01-12 Thread Anssi Kääriäinen
On Tue, Jan 12, 2016 at 11:22 PM, Shai Berger wrote: > Personally, I'd like it better if add() could still be used with an explicit > through model, provided that instances of the through model could be created > using only the two FK values +1 - Anssi -- You received this message because you

Re: re-thinking middleware

2016-01-12 Thread Mat Clayton
Hey guys, +1 as well, this is really great work, on both patches! Modifying the middleware stack mid request would be very useful for us. We currently run 3 copies of the same code, with essentially different urls.py and middlewares loaded, each one is used to run a variation of the site, for

Re: Make ManyToMany fields support "to_field".

2016-01-12 Thread Shai Berger
On Tuesday 12 January 2016 21:38:09 Luis Masuelli wrote: > Currently, if I want to create a ManyToMany relationship, I'm stuck with > two options: > > >- Accept the by-default configuration. This will imply the inner table >will have two fields based on the respective PKs. >- Create a

Make ManyToMany fields support "to_field".

2016-01-12 Thread Luis Masuelli
Currently, if I want to create a ManyToMany relationship, I'm stuck with two options: - Accept the by-default configuration. This will imply the inner table will have two fields based on the respective PKs. - Create a through-model. I will be able to specify two foreign keys, one f

Re: PostGres 9.5 Upsert

2016-01-12 Thread bliyanage
After thinking about it a bit, I think the only function that would really benefit from this would be the update_or_create. If you're doing get_or_create you still need a second query to get the actual row. On Friday, January 8, 2016 at 4:13:26 PM UTC-8, bliy...@rentlytics.com wrote: > > Hey G

Re: Support `manage.py shell -c 'run_code_as_django()'`?

2016-01-12 Thread Zach Borboa
Nice to see that this was implemented. $ cat myscript.py import django print(django.__version__) $ python manage.py shell --command="import myscript" 1.10.dev2016011210 The --command option lets you pass a command as a string to execute it as Django, like so: django-admin shell --comm

Is there a reason these features cannot be added inside Django core?

2016-01-12 Thread Luis Masuelli
These features are pretty core-related. 1. Features from django-polymorphic. To mantain bw compatibility, the hierarchy parent could need to add something like polymorphic=True in the meta to this feature be activated. 2. Something like this snippet regarding Inlines in admin: https://djangosni