Regression? evaluation of a lazy string in Template

2018-07-30 Thread Dražen Odobašić
Hi,

we are using Template engine to convert some translatable textual class level
attributes, like [0]. In the process of migration to Django2.0, we got a problem
with template Lexer which raises a `TypeError: expected string or bytes-like
object` [1]

I'm not sure if are just misusing the template system to do something what it
wasn't designed for, or if this is a regression from Django 1.11. Previously
Django was using `force_text` to force evaluation of a lazy string [2] and Lexer
always got a text object.

We could force the evaluation of the lazy strings in the application, but I was
wandering if this is a regression, and should actually be fixed in Django?

Dražen


[0]
https://github.com/rapidpro/rapidpro/blob/master/temba/channels/types/telegram/type.py#L27
[1] https://github.com/django/django/blob/2.0.7/django/template/base.py#L349
[2]
https://github.com/django/django/commit/3a148f95897c1379081118c30fbede6b6bc4#diff-8cbe1fb6d589cb6e35b956704d7a1285L154

-- 
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/bd16c255-f265-38ff-d444-8d267ab46d9b%40candela-it.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fellow Reports -- July 2018

2018-07-30 Thread Carlton Gibson
Hi all,


Calendar Week 30 -- ending 29 July.


Triaged:

https://code.djangoproject.com/ticket/29598 -- 
contrib.postgres.FloatRangeField should be renamed DecimalRangeField 
(Accepted)
https://code.djangoproject.com/ticket/29599 -- chunk_size for 
InMemoryUploadedFile is not used (Invalid)
https://code.djangoproject.com/ticket/29593 -- Removal of QUERY_TERMS is 
not in 2.1 "features removed" page (Accepted)


Reviewed:

https://code.djangoproject.com/ticket/29243 -- Improve efficiency of 
migration graph algorithm
https://code.djangoproject.com/ticket/28581 -- Pagination topic docs need a 
little restructuring
https://code.djangoproject.com/ticket/29589 -- Insert a new method 
part_page_range for class Page in django.core.paginator.py
https://code.djangoproject.com/ticket/26891 -- ForeignObject/ForeignKey 
does not obey lookup registration API
https://code.djangoproject.com/ticket/26184 -- Allow using custom lookups 
and transforms in ModelAdmin.search_fields
https://code.djangoproject.com/ticket/13091 -- admin list_editable with 
unique_together raises Integrity Error


Authored:

https://github.com/django/django/pull/10227 -- Fixed #29593 -- Added 
QUERY_TERMS removal to v2.1 release notes.
https://github.com/django/django/pull/10216 -- Refs #13091 -- Added test 
for commit=False idiom with partial unique_together validation.



Kind Regards,

Carlton

-- 
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/8ced471b-13a9-4289-b820-4c686fb8dec1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Regression? evaluation of a lazy string in Template

2018-07-30 Thread Tim Graham
It doesn't look like that force_text() was added specifically to handle 
lazy strings (see django/template/__init__.py in 
https://github.com/django/django/commit/953badbea5a04159adbfa970f5805c0232b6a401)
 
but Django does have str() calls in various places to handle lazy strings, 
e.g. 
https://github.com/django/django/blob/cebbcaa1baa6eb7f9ec3e223abdc496a983ea482/django/urls/resolvers.py#L486.
 
I think it would be fine to restore the old behavior. Can you create a 
ticket and offer a patch before the final bug fix release for Django 2.0.x 
on Wednesday?

On Monday, July 30, 2018 at 4:59:51 AM UTC-4, Dražen Odobašić wrote:
>
> Hi, 
>
> we are using Template engine to convert some translatable textual class 
> level 
> attributes, like [0]. In the process of migration to Django2.0, we got a 
> problem 
> with template Lexer which raises a `TypeError: expected string or 
> bytes-like 
> object` [1] 
>
> I'm not sure if are just misusing the template system to do something what 
> it 
> wasn't designed for, or if this is a regression from Django 1.11. 
> Previously 
> Django was using `force_text` to force evaluation of a lazy string [2] and 
> Lexer 
> always got a text object. 
>
> We could force the evaluation of the lazy strings in the application, but 
> I was 
> wandering if this is a regression, and should actually be fixed in Django? 
>
> Dražen 
>
>
> [0] 
>
> https://github.com/rapidpro/rapidpro/blob/master/temba/channels/types/telegram/type.py#L27
>  
> [1] 
> https://github.com/django/django/blob/2.0.7/django/template/base.py#L349 
> [2] 
>
> https://github.com/django/django/commit/3a148f95897c1379081118c30fbede6b6bc4#diff-8cbe1fb6d589cb6e35b956704d7a1285L154
>  
>

-- 
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/cb4609ec-6845-42ac-acb8-390211a05f22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing Channels - bin\\HostX86\\x64\\cl.exe' failed with exit status

2018-07-30 Thread Tim Graham
Hi Ryan, This mailing list is for the development of Django. Please use 
https://groups.google.com/forum/#!forum/django-users for usage questions. I 
think you're more likely to get help if you maintain a positive tone and 
omit sentences like "This is the problem with programming...".

On Sunday, July 29, 2018 at 1:55:35 PM UTC-4, Ryan M wrote:
>
> creating build\lib.win-amd64-3.7\twisted\protocols\test
> copying src\twisted\protocols\test\test_basic.py -> 
> build\lib.win-amd64-3.7\twisted\protocols\test
> copying src\twisted\protocols\test\test_tls.py -> 
> build\lib.win-amd64-3.7\twisted\protocols\test
> copying src\twisted\protocols\test\__init__.py -> 
> build\lib.win-amd64-3.7\twisted\protocols\test
> creating build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
> copying src\twisted\protocols\haproxy\test\test_parser.py -> 
> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
> copying src\twisted\protocols\haproxy\test\test_v1parser.py -> 
> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
> copying src\twisted\protocols\haproxy\test\test_v2parser.py -> 
> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
> copying src\twisted\protocols\haproxy\test\test_wrapper.py -> 
> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
> copying src\twisted\protocols\haproxy\test\__init__.py -> 
> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
> creating build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\deprecatedattributes.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\modules_helpers.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\pullpipe.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_appdirs.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_components.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_constants.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_deprecate.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_dist3.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_fakepwd.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_htmlizer.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_inotify.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_release.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_runtime.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_sendmsg.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_setup.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_shellcomp.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_syslog.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_systemd.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_textattributes.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_tzhelper.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_url.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_urlpath.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_util.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_versions.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_zippath.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\test_zipstream.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> copying src\twisted\python\test\__init__.py -> 
> build\lib.win-amd64-3.7\twisted\python\test
> creating build\lib.win-amd64-3.7\twisted\runner\test
> copying src\twisted\runner\test\test_inetdconf.py -> 
> build\lib.win-amd64-3.7\twisted\runner\test
> copying src\twisted\runner\test\test_procmon.py -> 
> build\lib.win-amd64-3.7\twisted\runner\test
> copying src\twisted\runner\test\test_procmontap.py -> 
> build\lib.win-amd64-3.7\twisted\runner\test
> copying src\twisted\runner\test\__init__.py -> 
> build\lib.win-amd64-3.7\twisted\runner\test
> creating build\lib.win-amd64-3.7\twisted\scripts\test
> copying src\twisted\scripts\test\test_scripts.py -> 
> build\lib.win-amd64-3.7\twisted\scripts\test
> copying src\twisted\scripts\test\__init__.p

Re: Regression? evaluation of a lazy string in Template

2018-07-30 Thread Dražen Odobašić
Yeah, I'll do it tomorrow ...

Dražen

On 30/07/18 15:19, Tim Graham wrote:
> It doesn't look like that force_text() was added specifically to handle lazy
> strings (see django/template/__init__.py in
> https://github.com/django/django/commit/953badbea5a04159adbfa970f5805c0232b6a401)
>  but
> Django does have str() calls in various places to handle lazy strings, e.g.
> https://github.com/django/django/blob/cebbcaa1baa6eb7f9ec3e223abdc496a983ea482/django/urls/resolvers.py#L486.
> I think it would be fine to restore the old behavior. Can you create a ticket
> and offer a patch before the final bug fix release for Django 2.0.x on 
> Wednesday?
> 
> On Monday, July 30, 2018 at 4:59:51 AM UTC-4, Dražen Odobašić wrote:
> 
> Hi,
> 
> we are using Template engine to convert some translatable textual class 
> level
> attributes, like [0]. In the process of migration to Django2.0, we got a
> problem
> with template Lexer which raises a `TypeError: expected string or 
> bytes-like
> object` [1]
> 
> I'm not sure if are just misusing the template system to do something 
> what it
> wasn't designed for, or if this is a regression from Django 1.11. 
> Previously
> Django was using `force_text` to force evaluation of a lazy string [2] and
> Lexer
> always got a text object.
> 
> We could force the evaluation of the lazy strings in the application, but 
> I was
> wandering if this is a regression, and should actually be fixed in Django?
> 
> Dražen
> 
> 
> [0]
> 
> https://github.com/rapidpro/rapidpro/blob/master/temba/channels/types/telegram/type.py#L27
> 
> 
> 
> [1] 
> https://github.com/django/django/blob/2.0.7/django/template/base.py#L349
> 
> [2]
> 
> https://github.com/django/django/commit/3a148f95897c1379081118c30fbede6b6bc4#diff-8cbe1fb6d589cb6e35b956704d7a1285L154
> 
> 
> 
> 
> -- 

-- 
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/c58bd0d3-d3a0-9ace-4e87-82a8051d5a35%40candela-it.com.
For more options, visit https://groups.google.com/d/optout.


Add natural key support for for generic foreign keys fixtures.

2018-07-30 Thread Guillaume Thomas
As asked by auvipy, this is a thread to discuss the implementation for this 
ticket.  


The idea in the proposed 
implementation  was: When 
a natural key is available for a GenericForeignKey, this one is used with 
the field name "content_object" rather than "object_id". 

As Tim Graham pointed out, that makes the *core* library (which contains 
fixtures serializers) aware of the generic foreign keys which are in the 
*contrib* library.

In the github PR, i proposed an approach where we declare dependencies 
between fields (eg object_id depends on content_type) and use these deps to 
serialize/deserialize in the good order and benefit from natural keys if 
they exist.

What do you think?

-- 
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/fb174017-4fcc-4537-b0bf-0046b14fbd00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing Channels - bin\\HostX86\\x64\\cl.exe' failed with exit status

2018-07-30 Thread Ryan McParlan
I just dont get why I have to install 7 gillion things from 7 different
places on to my computer when programminghow do people know all this is
secure? Now I need some program called docker.

No wonder computers are so insecure and people hack them all the time.

I mean there is so many tweeks i made just to get some small part to work.
How do you guys have conficence in  your secure computers at your
corperations. I dont get it.

layers upon layers of garbage(in a positive tone) to get things done...i
cant even learn what im suppose to learn.

On Mon, Jul 30, 2018 at 8:22 AM, Tim Graham  wrote:

> Hi Ryan, This mailing list is for the development of Django. Please use
> https://groups.google.com/forum/#!forum/django-users for usage questions.
> I think you're more likely to get help if you maintain a positive tone and
> omit sentences like "This is the problem with programming...".
>
> On Sunday, July 29, 2018 at 1:55:35 PM UTC-4, Ryan M wrote:
>>
>> creating build\lib.win-amd64-3.7\twisted\protocols\test
>> copying src\twisted\protocols\test\test_basic.py ->
>> build\lib.win-amd64-3.7\twisted\protocols\test
>> copying src\twisted\protocols\test\test_tls.py ->
>> build\lib.win-amd64-3.7\twisted\protocols\test
>> copying src\twisted\protocols\test\__init__.py ->
>> build\lib.win-amd64-3.7\twisted\protocols\test
>> creating build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
>> copying src\twisted\protocols\haproxy\test\test_parser.py ->
>> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
>> copying src\twisted\protocols\haproxy\test\test_v1parser.py ->
>> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
>> copying src\twisted\protocols\haproxy\test\test_v2parser.py ->
>> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
>> copying src\twisted\protocols\haproxy\test\test_wrapper.py ->
>> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
>> copying src\twisted\protocols\haproxy\test\__init__.py ->
>> build\lib.win-amd64-3.7\twisted\protocols\haproxy\test
>> creating build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\deprecatedattributes.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\modules_helpers.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\pullpipe.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_appdirs.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_components.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_constants.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_deprecate.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_dist3.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_fakepwd.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_htmlizer.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_inotify.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_release.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_runtime.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_sendmsg.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_setup.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_shellcomp.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_syslog.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_systemd.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_textattributes.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_tzhelper.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_url.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_urlpath.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_util.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_versions.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_zippath.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\test_zipstream.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> copying src\twisted\python\test\__init__.py ->
>> build\lib.win-amd64-3.7\twisted\python\test
>> creating build\lib.win-amd64-