Re: More standard template filters

2019-04-05 Thread Adam Johnson
FYI Jinja2 allows (most) python expressions, so this would Just Work(TM):

{{  myvar.startswith("x") }}

Django Template Language has a lot of legacy that prevents this from
happening, afaiu it would not be possible to move to it.

It's not hard to move your templates (asides from those extending external
packages like the admin) to Jinja2, since the syntax is very similar and
you can pop a Jinja2 backend in your TEMPLATES.



On Fri, 5 Apr 2019 at 07:43, Curtis Maloney  wrote:

> On 4/5/19 3:06 AM, Collin Anderson wrote:
> > Hi All,
> >
> > I use django templates a lot and I always wished there was a
> > myvar|startswith:"teststring", myvar|endswith:"teststring" and a
> > myvar|contains:"teststring" filter.
>
> It's almost like we need a syntax for calling methods with an argument,
> just like we can with filters.
>
> For example (bring on the sheds for bikes!)
>
>  {{ myvar.startswith<"teststring" }}
>
> > I instead do stuff like myvar|slice:":10" == "teststring" which is a
> > total hack.
> >
> > Is this something that could be simple and common enough to add to
> > django as batteries-included built-in?
>
> Alternatively, I recall some time in the past I may have written a
> "strings" template filter library simply to provide string methods as
> filters...
>
> --
> 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/a2b323bc-9f60-f4c9-6074-4d103bd6f930%40tinbrain.net
> .
> 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/CAMyDDM009Hh5VbtPVc_96iJmoJaDJE_K-pwbYAqo4%2BQcDeVraw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should we backport adding support for psycopg2 2.8 to the 1.11.x and 2.1.x?

2019-04-05 Thread Carlton Gibson
OK, so for me, this should go into v2.2, but not v2.1 or v1.11. (I see you 
already backported to 2.2 so... 🙂)

My general take here is that we could be half-a-notch more generous 
backporting to the current version (e.g. 2.2 now) but should be just as 
strict as we are once a version is out of mainstream support. (Loosely: 
Given how easy the update process is these days, I don't think we do anyone 
any favours keep older versions on life-support...) 

C.

On Thursday, 4 April 2019 14:52:23 UTC+2, Mariusz Felisiak wrote:
>
> Patch for adding support for psycopg2 *2.8* is ready (see ticket #30331 
> 
>  
> and PR11171 ). Fix is quite 
> straightforward and works with all supported version of psycopg2, i.e. 
> *2.5.4+*. The question is, should we backport this fix to the *1.11.x* 
> and *2.1.x*? Theoretically it doesn't qualify due to our backport policy, 
> because both are in the "extended support" time.
>

-- 
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/c7a802c5-c19a-41de-8283-abd742144541%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should we backport adding support for psycopg2 2.8 to the 1.11.x and 2.1.x?

2019-04-05 Thread Mariusz Felisiak
Agreed. I will document that 1.11 and 2.1 require psycopg2 *2.5.4* through 
*2.7.7* versions.

We can re-open this discussion in the future if e.g. psycopg2 2.8.x will 
contain some important security patch.

-- 
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/bae59229-dd3b-4690-9c06-52e322ea1f9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: GSoC Proposal (FormSet Improvement)

2019-04-05 Thread PARTH PATIL
I have updated my proposal please have a look

On Wednesday, April 3, 2019 at 9:22:57 PM UTC+5:30, Carlton Gibson wrote:
>
> Yes, just pseudo code — so when reviewing your proposal next week it's 
> easy to see that it'll be the right approach. 🙂
>
> On Wednesday, 3 April 2019 17:51:18 UTC+2, PARTH PATIL wrote:
>>
>>
>>
>> On Wednesday, April 3, 2019 at 8:58:26 PM UTC+5:30, Carlton Gibson wrote:
>>>
>>> Hey Parth. 
>>>
>>> Right. So, thanks for making the effort so far. Good. 
>>>
>>> Can you add more detail about yourself. You've not contributed to Django 
>>> right? So the concern at this point would be whether you're able to fulfil 
>>> the project. 
>>>
>>
>> I have contributed to Django (see #30189 
>> ), I have mentioned it at 
>> the end of my proposal, I would try to highlight that. 
>>
>>  
>>
>>> What's your experience with Django? (and if you want to implement a 
>>> declarative formset syntax, Python more generally?)
>>> (Perhaps you said this, but it needs to be in the proposal.) 
>>>
>>
>> Sure I will add some of my projects in the proposal. 
>>
>>>
>>> You don't necessarily need to have ideas for the final code, but what 
>>> does e.g. the usage look like with your idea (i.e. adding the request 
>>> parameter)? 
>>> (So the formset gets the request and this is available where...? and so 
>>> on: can you SHOW in your proposal that this WILL address the issues?)
>>>
>>
>> I'm a little bit confused here, What you mean by "SHOW that this works"? 
>>
>>- Do you just write some pseudo code, and say this will work?
>>- Or I have to prove in some way that this will work??
>>
>>
>>> HTH.
>>>
>>> Kind Regards,
>>>
>>> Carlton
>>>
>>>
>>> On Monday, 1 April 2019 21:29:33 UTC+2, PARTH PATIL wrote:

 Here is a link to my GSoC proposal
 Its a first draft so you are open to comment and suggest changes


 https://docs.google.com/document/d/1JuoVOU5xMwXY7JrHJshezIyuIpFfoEM49rO3e0rfNhE/edit?usp=sharing


 Best Regards,

 PARTH PATIL

 SOFTWARE DEVELOPER, AUV-IITB

 CONVENOR, ELECTRONICS & ROBOTICS CLUB IIT BOMBAY.

 [image: Image result for FACEBOOK ROUND ICON] 
  [image: Image result for 
 instagram ROUND ICON]  [image: 
 Image result for linkedin ROUND ICON] 
 



-- 
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/a3957e91-da52-481f-90c2-49f3f5f8e22d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: More standard template filters

2019-04-05 Thread Curtis Maloney

On 4/5/19 8:16 PM, Adam Johnson wrote:

FYI Jinja2 allows (most) python expressions, so this would Just Work(TM):

{{  myvar.startswith("x") }}

Django Template Language has a lot of legacy that prevents this from 
happening, afaiu it would not be possible to move to it.


For "legacy" read "philosophical choices" :)

--
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/496aa5dc-058c-4126-164a-e421cd20162a%40tinbrain.net.
For more options, visit https://groups.google.com/d/optout.