Re: Proposal: django.contrib.mysql

2017-05-10 Thread Adam Johnson
>
> How about making the package official extension and bring under django org?
>

I thought about this, but a few parts of Django-MySQL are incredibly hacky

and should probably not be "officially supported code".

On 10 May 2017 at 13:43, Sérgio Basto  wrote:

>
>
> On Monday, May 8, 2017 at 4:22:04 PM UTC+1, Adam Johnson wrote:
>
>> Sérgio, django-mysql already fully supports MySQL 5.7's JSON type with
>> its JSONField: https://django-mysql.readthedocs.io/en/latest/
>> model_fields/json_field.html . Try that.
>>
>
> yes , I'm using it now and works great, many thanks .
>
> BTW the serialize issue that I had (I don't know if I already mention
> here) is fixed in
>
> Fix JSONField to work with Django's serializer framework
> commit
> in https://github.com/adamchainz/django-mysql/compare/v1.1.1...master
> i.e is not yet released , maybe should be ...
>
> Thanks
>
>
> 
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-developers/sAgYOqBUvgI/unsubscribe.
> To unsubscribe from this group and all its topics, 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/224650e0-efe3-4b69-bc62-
> d84d17e16298%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/CAMyDDM1m0gBVvzyL0-oNEjW5nLDxYX7u%2BBbNJVxLxpME-qhO5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: raise error for form attribute

2017-05-10 Thread Adam Johnson
clean() and non_field_error both seem like the wrong place since they
happen after the first rendering of the form. You should be able to raise
it on initialization, no?

On 10 May 2017 at 10:19, Naveen Yadav  wrote:

> Hi,
>
> I am working on my first issue
> . Part of solution seems
> like
> 1. checking the concerned fields
> 2. raising the error if required
>
>
> After going through the source code, I realized there two ways to resolve
> the issue, first one seems raise error at appropriate place although a few
> doubts about this
>
> *raise error:*
>
>1. appropriate place to raise error clean() of form class, Will it be
>fine if i raise error here ?
>
> *non_field_error*
>
> second solution would be add non_field_error for the form.
>
> Any feedback would be helpful
>
> 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/74b94cdc-987d-40bf-a956-
> 7a5a97fe7cc2%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/CAMyDDM3n3160k_8hthMVWUtPku%3DqmbBQ6jaagfo4sA45EFzaRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: django.contrib.mysql

2017-05-10 Thread Sérgio Basto


On Monday, May 8, 2017 at 4:22:04 PM UTC+1, Adam Johnson wrote:

> Sérgio, django-mysql already fully supports MySQL 5.7's JSON type with 
> its JSONField: 
> https://django-mysql.readthedocs.io/en/latest/model_fields/json_field.html 
> . Try that.
>

yes , I'm using it now and works great, many thanks .

BTW the serialize issue that I had (I don't know if I already mention here) 
is fixed in 

Fix JSONField to work with Django's serializer framework 
commit
 
in https://github.com/adamchainz/django-mysql/compare/v1.1.1...master 
i.e is not yet released , maybe should be ... 

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/224650e0-efe3-4b69-bc62-d84d17e16298%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


raise error for form attribute

2017-05-10 Thread Naveen Yadav
Hi,

I am working on my first issue . 
Part of solution seems like 
1. checking the concerned fields 
2. raising the error if required


After going through the source code, I realized there two ways to resolve 
the issue, first one seems raise error at appropriate place although a few 
doubts about this

*raise error:*

   1. appropriate place to raise error clean() of form class, Will it be 
   fine if i raise error here ?
   
*non_field_error*

second solution would be add non_field_error for the form.

Any feedback would be helpful

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/74b94cdc-987d-40bf-a956-7a5a97fe7cc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems around SchemaEditor._alter_field

2017-05-10 Thread Mariusz Felisiak
I agree that *_alter_field *should be refactored, because currently is 
unmaintainable or at least really hard to maintain. I checked and some of 
the official 3rd-party database backends [1] use this private API i.e. 
django-mssql 
[2], django-firebird [3]. Maybe we should take that into account.

[1]: 
https://docs.djangoproject.com/en/1.11/ref/databases/#using-a-3rd-party-database-backend
[2]: 
https://bitbucket.org/Manfre/django-mssql/src/d44721ba17acf95da89f06bd7270dabc1cd33deb/sqlserver_ado/schema.py?at=master=file-view-default#schema.py-152
[3]: 
https://github.com/maxirobaina/django-firebird/blob/master/firebird/schema.py#L112

-- 
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/501dd0f8-caf1-4aae-b56f-00a46768d41c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DEP pre-proposal for a simpler URLs syntax.

2017-05-10 Thread Sjoerd Job Postmus
On Wednesday, May 3, 2017 at 12:35:30 AM UTC+2, Marten Kenbeek wrote:
>
>  
>
>>
>>- The more complex part is (I think) figuring out how to deal with 
>>cases where we have a `path('/', include(other_urls))` and 
>>`other_urls` also has a `path()` mentioning `something`. However this 
>> might 
>>just be my perfectionism and paranoia seeing edge-cases where there are 
>>none, or are sufficiently "edge" cases that we can suffice with a "just 
>>don't do it!".
>>
>>
>  The current resolver doesn't really handle this either. When resolving, 
> the current implementation simply passes on the outermost capture group to 
> the view. When reversing you can only pass in a single value that must 
> match both groups. If you can solve it, great, but I think it's sufficient 
> to let the underlying resolver handle it the same way. 
>

Yes, that's somewhat what I expected as well, just wasn't as sure. I 
*think* it's probably better to make a check that the capture groups do not 
overlap than to write code to deal with that elegantly. But that could 
probably happen in a different PR.

-- 
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/427a0347-4fa9-4692-88e4-a35248e408ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.