Form.factory

2017-12-18 Thread Jamesie Pic
Hello everybody,

Currently, we can set extra request/view arguments in a form by overriding
a CBV get_form* method. This way, we can add things such as request.user,
if we also override the Form constructor to accept such arguments.

I'd like to suggest that we add a factory(cls, view) method to the Form
class, and make CBV call self.form_class.factory(view, *ctor_args,
**ctor_kwargs) as a way to keep the view->form variables logic in a single
place.

Thanks for your time
Best regards
<3

-- 
∞

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAC6Op1_OFL6vOGH-PxXmx4zNkUxQMFhEN7Ded4e1zYhL50QEyw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello everyone I'm a new member

2017-12-18 Thread dpa-django
Hello Asad,

as a first task you can remove the Python2-specifics from 
django/utils/six.py , and deprecate python_2_unicode_compatible().

Greetings
  Дилян

On Wednesday, December 13, 2017 at 3:10:31 AM UTC+1, Asad Ahmed wrote:
>
> Hello everyone,
> I'm new to open source community. I've been working on python and django 
> framework for few years now. I've done few projects based on them and ML. 
> I'm planing for Gsoc.
> I would be really grateful if anyone can guide me on how to proceed for 
> open source contribution on django.
>
> Thanks
> Your sincerely 
> Asad Ahmed
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/5d3082f3-ff2e-442b-9886-04e1e8119eac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello everyone I'm a new member

2017-12-18 Thread Adam Johnson
Please don't do that, as I recall we'll just delete django.utils.six after
the minimum recommended django version for third party libraries is 2.0.

On 18 December 2017 at 15:05,  wrote:

> Hello Asad,
>
> as a first task you can remove the Python2-specifics from
> django/utils/six.py , and deprecate python_2_unicode_compatible().
>
> Greetings
>   Дилян
>
> On Wednesday, December 13, 2017 at 3:10:31 AM UTC+1, Asad Ahmed wrote:
>>
>> Hello everyone,
>> I'm new to open source community. I've been working on python and django
>> framework for few years now. I've done few projects based on them and ML.
>> I'm planing for Gsoc.
>> I would be really grateful if anyone can guide me on how to proceed for
>> open source contribution on django.
>>
>> Thanks
>> Your sincerely
>> Asad Ahmed
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/5d3082f3-ff2e-442b-9886-
> 04e1e8119eac%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM3RtMCq_Ki8dqb5r%3DU9%2BKHhtb%2BGnYkKPX0dCHO344OPDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello everyone I'm a new member

2017-12-18 Thread Collin Anderson
Yes, wait until at least 2019 to deprecate those.
https://code.djangoproject.com/ticket/27753

On Mon, Dec 18, 2017 at 10:45 AM, Adam Johnson  wrote:
> Please don't do that, as I recall we'll just delete django.utils.six after
> the minimum recommended django version for third party libraries is 2.0.
>
> On 18 December 2017 at 15:05,  wrote:
>>
>> Hello Asad,
>>
>> as a first task you can remove the Python2-specifics from
>> django/utils/six.py , and deprecate python_2_unicode_compatible().
>>
>> Greetings
>>   Дилян
>>
>> On Wednesday, December 13, 2017 at 3:10:31 AM UTC+1, Asad Ahmed wrote:
>>>
>>> Hello everyone,
>>> I'm new to open source community. I've been working on python and django
>>> framework for few years now. I've done few projects based on them and ML.
>>> I'm planing for Gsoc.
>>> I would be really grateful if anyone can guide me on how to proceed for
>>> open source contribution on django.
>>>
>>> Thanks
>>> Your sincerely
>>> Asad Ahmed
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/5d3082f3-ff2e-442b-9886-04e1e8119eac%40googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Adam
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAMyDDM3RtMCq_Ki8dqb5r%3DU9%2BKHhtb%2BGnYkKPX0dCHO344OPDA%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFO84S6GxYXtiFFU-F3r80AzdRCLBH6f%2BaAAqDtu1PuvMdbQxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Provide option to chain QuerySet.order_by()

2017-12-18 Thread Shai Berger
On Fri, 15 Dec 2017 21:01:39 +
Adam Johnson  wrote:

> I would prefer the QuerySet method than documenting parts of Query -
> QuerySet shouldn't have to make guarantees that its interactions with
> Query won't change, plus making Query in some way a public API could
> hamper features. Plus the amount of code is small and contained.
> 

I agree, but I think that method should be get_ordering(). 

> Also I think worrying about 'nonsense' cases is a bit of a
> distraction, we already support some 'nonsense' cases
> like .order_by('?', '?') 

I grant that that's not a super-strong argument. However, making the
ordering available is also more flexible -- it allows you to do things
like copying the ordering between querysets, or modifying the ordering
based on existing ordering (e.g. reverse the ordering), or other things
I can't come up with off the top of my head, and which the suggested
API doesn't enable.

Shai

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/20171218233351.5e08ebc8.shai%40platonix.com.
For more options, visit https://groups.google.com/d/optout.