Re: Force "required" fields to be included in a ModelForm

2019-04-17 Thread PARTH PATIL
Yes I agree with others, that this should not be implemented. As I find
this too much specific to just your case.

There are many cases, like what if there is some required field which the
developer wants to set by themselves and don't want user to edit that
(transaction details maybe for a shopping site).

You may Inherit a class from modelform and overide the behaviour for your
project, buy I dont think this should be included in Django.

Best Regards,
PARTH PATIL


On Wed, 17 Apr 2019, 12:15 pm Harro,  wrote:

> I'm against, there are lots of cases where a modelform is used to edit an
> exitsting object and thus the required fields are already set and you don't
> want them to be editable.
>
> If it's a trivial patch then you should think about extending modelform in
> your own project enforce it there and then use it instead of the normal
> modelform.
>
> I also think a good test setup/protocol will catch missing fields pretty
> quickly as you won't be able to actually create the object.
>
> On Wednesday, 17 April 2019 02:34:12 UTC+2, Will Gordon wrote:
>>
>> In the same way that editable fields are forced to not be included in a
>> ModelForm (
>> https://github.com/django/django/blob/master/django/forms/models.py#L146),
>> I would like to propose that "required" fields (`blank=False`) be forced to
>> be included in a ModelForm.
>>
>> While I understand that a developer can force this inclusion themselves,
>> but on a large project, it should not be necessary to always ensure that a
>> Model and ModelForm are in sync.
>>
>> Since this is probably a non-trivial patch (
>> https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#non-trivial-patches)
>> I need to provide evidence that this has been discussed. As such, I'm open
>> to any and all opinions!
>>
> --
> 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/a51d1c72-c724-448f-b804-344cb33d176f%40googlegroups.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/CAJSC-ifeKKX0zp1F48dm%3DQSRe%2BBds4r4_nM_0fn3ih9CpTVQUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Force "required" fields to be included in a ModelForm

2019-04-17 Thread Tobias Kunze
On 19-04-16 17:34:11, Will Gordon wrote:
>In the same way that editable fields are forced to not be included in a 
>ModelForm (
>https://github.com/django/django/blob/master/django/forms/models.py#L146), 
>I would like to propose that "required" fields (`blank=False`) be forced to 
>be included in a ModelForm.

Is there anything missing in Django that would prevent you from doing
this in a subclass of ModelForm? My projects tend to go with one or two
common base classes in between actual forms/views and Django's
forms/views, and I'd argue that this is not too much trouble for a
feature like this.

I'm also against adding a warning for this by default – I'd like to keep
warnings reserved for issues with more of an impact. I think for every
one of my larger projects, I'd have to silence this warning, which is
annoying (and keeping it there introduces warning fatigue, which Django
so far does a good job of avoiding).

Tobias

-- 
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/20190417080037.uu2ybg3etwespmen%40cordelia.localdomain.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: Proposal to format Django using black

2019-04-17 Thread Tobias Kunze
Hi Dan,

On 19-04-16 20:33:29, Dan Davis wrote:
>+1 isort
>-1 black
>
>I think that codestyle checkers are better, because you teach yourself
>proper style for python.

I appreciate this argument, but: As Django community our primary concern
in this discussion has to be the impact black would have on the Django
code base and the Django development process – educating our
contributors cannot be a primary concern, compared to making
contributions as easy as possible.

Tobias

-- 
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/20190417082648.miicsigxjwoevmkl%40cordelia.localdomain.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: Proposal to format Django using black

2019-04-17 Thread Tom Forbes
I would be +1 for Black. I think it makes a lot of sense for a project like 
Django, and it does seem that a non trivial amount of both contributor and 
reviewer time is spent on formatting fixes.

The choice of double quotes by default used to annoy me, but after using black 
for a while I think that the benefits outweigh the downsides.

One thing we have not considered here is that after running black on Django a 
huge portion of our outstanding merge requests will have conflicts, some of 
which might be tricky to rebase. I’m not sure there is much we can do about 
that though.

Tom

> On 17 Apr 2019, at 09:26, Tobias Kunze  wrote:
> 
> Hi Dan,
> 
>> On 19-04-16 20:33:29, Dan Davis wrote:
>> +1 isort
>> -1 black
>> 
>> I think that codestyle checkers are better, because you teach yourself
>> proper style for python.
> 
> I appreciate this argument, but: As Django community our primary concern
> in this discussion has to be the impact black would have on the Django
> code base and the Django development process – educating our
> contributors cannot be a primary concern, compared to making
> contributions as easy as possible.
> 
> Tobias
> 
> -- 
> 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/20190417082648.miicsigxjwoevmkl%40cordelia.localdomain.
> 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/AFFEB466-A328-4DA6-8845-F2DFB55C1ED1%40tomforb.es.
For more options, visit https://groups.google.com/d/optout.


Re: GSOC Proposal : CrossDB JSON Field

2019-04-17 Thread Rohit Jha
Hi Carlton,

I have already submitted this proposal to Google, I will be glad if you can
go through it.

Thanks & Regards






On Wed, Apr 17, 2019 at 12:28 PM Carlton Gibson 
wrote:

> Deadline for submissions has passed. I’m reviewing this week.
>
> On Wed, 17 Apr 2019 at 08:52, Adam Johnson  wrote:
>
>> Hi Rohit!
>>
>> It seems your email thread has been missed by the list, I don't know why,
>> perhaps it hit some spam filters. There's also another thread from a
>> student proposing the same projectt:
>>
>>
>> https://groups.google.com/d/msgid/django-developers/415dbb68-d1a8-4642-8908-e6414dde1ad0%40googlegroups.com
>>
>> I think the last message on that thread is a big development with regards
>> to this project, since Raphael has written a third-party implementation
>> that has most of the features:
>> https://github.com/raphaelm/django-jsonfallback
>>
>> I'm not sure what we do with regards to two GSOC proposals for the same
>> task, maybe Carlton or others would like to weigh in?
>>
>> Thanks,
>>
>> Adam
>>
>> On Fri, 5 Apr 2019 at 03:02, Rohit Jha  wrote:
>>
>>> Hi
>>>
>>> I am Rohit Jha, I am a sophomore at IIT Roorkee. I am planning to
>>> participate in GSOC. My draft Proposal can be found here :
>>>
>>>
>>> https://docs.google.com/document/d/1jSEir_wuYlBqvQTmWJUF3mpquuIH4ElZG1hFBeMl1HI/edit?usp=sharing
>>>
>>> Feedback is much appreciated
>>>
>>> Thanks
>>>
>>> --
>>> 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/fcaed3da-3b9f-44a0-85a5-7d5007775360%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/CAMyDDM10QJiERJ_hPW9cGP5ZZmYhzNcG6Ufny57a9MuL1uNLiA%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/CAJwKpyTg-x8QCVCTn4ziZ2kGbjzZx%2BRjDhe3P9Lthn_xzfxeGA%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/CAJmB4Kca8B0P95EoqXRtsOURTH7_%2BEHO23ycTkstJy9bpJp0aA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Force "required" fields to be included in a ModelForm

2019-04-17 Thread Will Gordon
Well shoot...this definitely seems like something only I'm running into. 
Appreciate y'alls feedback. Thanks 👍🏻

-- 
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/d024a7bd-b0c6-48ef-ad54-0e4f473757a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal to format Django using black

2019-04-17 Thread Jon Dufresne
> One thing we have not considered here is that after running black on
Django a huge portion of our outstanding merge requests will have
conflicts, some of which might be tricky to rebase. I’m not sure there is
much we can do about that though.

With a little bit of git-foo, this is actually not that bad. In past
projects, this is the approach I took:

$ git checkout my-branch
# Rebase on the parent of the commit introducing Black.
$ git rebase ^
# Fix normal merge conflicts.
# ...
# Rebase on the Black commit, instructing git to prefer the rebased
changes
# over the black changes. For rebase, the terminology is backwards,
hence
# "theirs".
$ git rebase  -X theirs
# Reformat your changes with black.
$ black .
# Amend the commit with the Black formatting changes.
$ git commit --ammend -a

-- 
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/CADhq2b7JD6C-wqyKgPVDK0JOvX_W_vgzAe%2Be6TcSkC6ArPm5jA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why does ModelForm do validation and not Model

2019-04-17 Thread Curtis Maloney

On 4/17/19 4:55 AM, Aymeric Augustin wrote:

Hello Will,

It's mostly for performance reasons, since validation can be expensive. 


Really? My memory was that it was (a) backward compatibility [model 
validation was added later], and (b) practicality [try catching 
everywhere in your code you save a model, and enforce catching 
validation exceptions there].


Models _support_ validation, but don't _enforce_ it.

--
Curtis

--
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/f162b3b7-3045-e1f2-e82e-e18fa6de49c5%40tinbrain.net.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal to format Django using black

2019-04-17 Thread Brice Parent

Le 17/4/19 à 2:33, Dan Davis a écrit :

+1 isort
-1 black

I think that codestyle checkers are better, because you teach yourself 
proper style for python.


I'm in a team in which we've enforced Black a bit more than a year ago, 
and I can tell you that now, everyone code in a blackish style from 
start. Black is still always executed, but doesn't make any change most 
of the time. It's just there to enforce the style, for newcomers and if 
we sometimes make some style mistakes.


A big win here.

[snip]

--
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/23ba5efe-f290-c3d7-e24f-8e109d61efb9%40brice.xyz.
For more options, visit https://groups.google.com/d/optout.


django_chatterbot

2019-04-17 Thread Abhineet Baranwal
Hello there, 
I am using* django chatterbot *but whenevere i typed any new sentence and 
hit enter then *the bot* returns always the current time.I do not know why 
it always respond with the current time .Any ideas?

And can anyone tell me how we can train my personal data with django 
chatterbot ?


-- 
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/02cefd26-feed-49be-9dc8-19cb80827a6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.