Re: TemplateView and FormView inconsistency

2019-08-14 Thread Adam Johnson
I came up with a PR that will raise a deprecation warning on variable
access - see the ticket.

On Wed, 14 Aug 2019 at 14:46, step21  wrote:

> I do not have a better idea right now, but also do not know the django
> core code that well. Personally, as you could get all TemplateViews via Ack
> or another code search method, I do not think replacing them would take
> long.
>
> Am 14.08.2019 um 09:45 schrieb Adam Johnson :
>
> Hi,
>
> After reading the ticket, I agree this could be deprecated as a backwards
> incompatibility. The deprecation plan suggested by loic84 looks like it
> could work but would be a bit unwieldy on large projects. Maybe there's
> another path?
>
> One thing that's not explicitly in the discussion: the view kwargs are
> always accessible inside templates because ContextMixin.get_context_data
> passes 'view', and view.kwargs is always set by View.setup().
>
> Thanks,
>
> Adam
>
> On Wed, 14 Aug 2019 at 01:56, step21  wrote:
>
>> Hi all,
>>
>> When developing I noticed an inconsistency - when using TemplateView,
>> kwargs are passed to context, but not when using FormView or others.
>>
>> Source comparison:
>>
>> https://dpaste.de/Jwdn
>>
>> Relevant super old issue talking about depreciation here:
>> https://code.djangoproject.com/ticket/19878
>>
>> I discussed this briefly on IRC and was told to post here, as it is an
>> inconsistency and maybe should be fixed but maybe wasn’t for a reason.
>> Seeing as there was already talk of depreciating it several years ago and
>> no clear opposition, maybe I could prepare a patch for it?
>> Any thoughts?
>>
>> F
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/5072B2EE-D2B4-448C-936D-C5FDB5CD7132%40devtal.de
>> .
>>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAMyDDM1Jxg468YdVyLMkhQnuaCq7E9VVB3ucJkRXSNptKRXTDQ%40mail.gmail.com
> 
> .
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/53F53122-8D8E-40BE-ADB9-F9AE77E737DA%40devtal.de
> 
> .
>


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM1e%2B77AP00YgBXq7tXPmj9MrcsKVqJFUMdXMkstxy7HMQ%40mail.gmail.com.


Re: TemplateView and FormView inconsistency

2019-08-14 Thread step21
I do not have a better idea right now, but also do not know the django core 
code that well. Personally, as you could get all TemplateViews via Ack or 
another code search method, I do not think replacing them would take long.

> Am 14.08.2019 um 09:45 schrieb Adam Johnson :
> 
> Hi,
> 
> After reading the ticket, I agree this could be deprecated as a backwards 
> incompatibility. The deprecation plan suggested by loic84 looks like it could 
> work but would be a bit unwieldy on large projects. Maybe there's another 
> path?
> 
> One thing that's not explicitly in the discussion: the view kwargs are always 
> accessible inside templates because ContextMixin.get_context_data passes 
> 'view', and view.kwargs is always set by View.setup().
> 
> Thanks,
> 
> Adam
> 
> On Wed, 14 Aug 2019 at 01:56, step21  > wrote:
> Hi all,
> 
> When developing I noticed an inconsistency - when using TemplateView, kwargs 
> are passed to context, but not when using FormView or others.
> 
> Source comparison:
> 
> https://dpaste.de/Jwdn 
> 
> Relevant super old issue talking about depreciation here:
> https://code.djangoproject.com/ticket/19878 
> 
> 
> I discussed this briefly on IRC and was told to post here, as it is an 
> inconsistency and maybe should be fixed but maybe wasn’t for a reason. Seeing 
> as there was already talk of depreciating it several years ago and no clear 
> opposition, maybe I could prepare a patch for it?
> Any thoughts?
> 
> F
> 
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/5072B2EE-D2B4-448C-936D-C5FDB5CD7132%40devtal.de
>  
> .
> 
> 
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/CAMyDDM1Jxg468YdVyLMkhQnuaCq7E9VVB3ucJkRXSNptKRXTDQ%40mail.gmail.com
>  
> .

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/53F53122-8D8E-40BE-ADB9-F9AE77E737DA%40devtal.de.


signature.asc
Description: Message signed with OpenPGP


Re: Django LTS support time

2019-08-14 Thread Josh Smeaton
I don't think the DSF has the capacity or the will to run a business 
offering paid support contracts.

But nothing is stopping an enterprising individual or company from doing 
so. All security patches are made public (eventually) and backporting fixes 
would be fairly low effort. https://railslts.com/ is prior art in this 
space.

I'm incredibly surprised no one has started up a business to do this for 
Django.

On Tuesday, 13 August 2019 10:32:21 UTC+10, 1337 Shadow Hacker wrote:
>
> Actually I'm pretty sure it could be done even if DSF kept a profit, to 
> re-inject it into other developments for exemple. AFAIK the major 
> difference between non-profit and company is that you don't own it and as 
> such you cannot take dividends out of it personally. IMHO everybody would 
> benefit if DSF did more commerce and was stronger by that mean. I could 
> sing an ode to commerce but that would be much off-topic.
> *אורי* if you're looking for commercial extension you can certainly hire 
> someone for that for the time being, Patryk's company seems to have willing 
> developers, or hire someone to face the debt in your codebase, which 
> Patryk's company will probably recommend for the same budget. Sorry for 
> being so binary but unless another idea emerges from this topic...  it 
> seems pretty cornered at this point, sorry for not being more helpful.
>
> Best of luck
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ce923775-e684-43ad-ae16-e6db236e04d7%40googlegroups.com.


Re: Creating a new "Triage & Review Team"

2019-08-14 Thread Josh Smeaton
I think that's sensible, including making the team public.

> This struck me as a little absurd: if we weren't going to dissolve it, 
Nick should definitely be part of the old "Django Core".

It's not done yet, and while we're in this limbo stage, we're potentially 
missing out on some good maintainers before a decision has even been made. 
You can still put forward names for the core team if you think they'd make 
good members,  though I'd understand your hesitation.

On Tuesday, 13 August 2019 05:12:51 UTC+10, Carlton Gibson wrote:
>
> Oh, one more thing. I'd like to make this a "Public" team. I think there 
> should be some visibility and recognition for the folks who work so hard on 
> keeping Django strong. 
>
> As part of that I'd add it to the Teams list on djangoproject.com, and 
> maintain a list of previous members, for those who had stepped down. 
>
> C. 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/8b5b205e-56ca-44dc-bfd8-8a22de90be60%40googlegroups.com.


Re: I need help

2019-08-14 Thread Pavlos Georgiadis
Hi Fadi,

This is the developers mailing list dedicated to development of django
itself. Questions like this should be addressed to the users mailing list.


P.S: Do a search for "django model property decorator" (there is also a
cached_property decorator). It will help you find a solution.

--
Pavlos Georgiadis



On 14/08/2019 05:22, 'Fadi Haddad' via Django developers (Contributions
to Django itself) wrote:
> Hi, 
>
> I have created a table called dataset
>
> I put the age as integer e.g. 34, 23, 10, 47 
>
> I need to create Age range for the age column. I need the age to be
> displayed as [1-10], [11,20], [21-30] ... etc. Can this happen by
> replacing values or do I have to create another column for this? The
> goal is to anonymize my dataset therefore if it is possible to replace
> values (age) rather than creating new column would be excellent.   
>
> Can anyone help me how to code this in SQL? Would be appreciated if
> code is included in the response 
>
> Regards
>
> Fadi
> -- 
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/79b8a25a-ce6b-4a73-9be2-d67c7d78e2ff%40googlegroups.com
> .

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/bc6be538-ae87-3ada-800f-a37020cc12ba%40georgiadis.eu.


I need help

2019-08-14 Thread Become a Physicist
You can create a drop down menu for this.

AGE_CHOICES = (
('11-20','11-20'),
('21-30', '21-30'),
)

class MyModel(models.Model):
  color = models.CharField(max_length=6, choices=AGE_CHOICES, blank=True, 
null=True) 

Hope this helps...  
With regards, 
Shubham Gupta 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/dbb7403f-37d8-4f34-aa86-9f0861382964%40googlegroups.com.


Re: TemplateView and FormView inconsistency

2019-08-14 Thread Adam Johnson
Hi,

After reading the ticket, I agree this could be deprecated as a backwards
incompatibility. The deprecation plan suggested by loic84 looks like it
could work but would be a bit unwieldy on large projects. Maybe there's
another path?

One thing that's not explicitly in the discussion: the view kwargs are
always accessible inside templates because ContextMixin.get_context_data
passes 'view', and view.kwargs is always set by View.setup().

Thanks,

Adam

On Wed, 14 Aug 2019 at 01:56, step21  wrote:

> Hi all,
>
> When developing I noticed an inconsistency - when using TemplateView,
> kwargs are passed to context, but not when using FormView or others.
>
> Source comparison:
>
> https://dpaste.de/Jwdn
>
> Relevant super old issue talking about depreciation here:
> https://code.djangoproject.com/ticket/19878
>
> I discussed this briefly on IRC and was told to post here, as it is an
> inconsistency and maybe should be fixed but maybe wasn’t for a reason.
> Seeing as there was already talk of depreciating it several years ago and
> no clear opposition, maybe I could prepare a patch for it?
> Any thoughts?
>
> F
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/5072B2EE-D2B4-448C-936D-C5FDB5CD7132%40devtal.de
> .
>


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM1Jxg468YdVyLMkhQnuaCq7E9VVB3ucJkRXSNptKRXTDQ%40mail.gmail.com.


Re: I need help

2019-08-14 Thread Adam Johnson
Hi!

I think you've found the wrong mailing list for this post. This mailing
list is for the development of Django itself, not for support using Django.
This means the discussions of bugs and features in Django itself, rather
than in your code using it. People on this list are unlikely to answer your
support query with their limited time and energy. Read more on the mailing
lists at https://www.djangoproject.com/community/

For support, please use the django-users mailing list, or IRC #django on
Freenode, or a site like Stack Overflow. There are people out there willing
to help on those channels, but they might not respond if you don't ask your
question well. Stack Overflow's question guide can help you frame it well:
https://stackoverflow.com/help/how-to-ask .

Also if you haven't read it, please take a look at Django's Code of
Conduct: https://www.djangoproject.com/conduct/ . These are our "ground
rules" for working well as a community, and will help you get the most out
of Django and our fantastic community.

On your question - I think you want the SQL CASE and WHEN which are mapped
in the Django ORM as the Case and When functions:
https://docs.djangoproject.com/en/2.2/ref/models/conditional-expressions/

Thanks for your understanding,

Adam

On Wed, 14 Aug 2019 at 03:22, 'Fadi Haddad' via Django developers
(Contributions to Django itself)  wrote:

> Hi,
>
> I have created a table called dataset
>
> I put the age as integer e.g. 34, 23, 10, 47
>
> I need to create Age range for the age column. I need the age to be
> displayed as [1-10], [11,20], [21-30] ... etc. Can this happen by replacing
> values or do I have to create another column for this? The goal is to
> anonymize my dataset therefore if it is possible to replace values (age)
> rather than creating new column would be excellent.
>
> Can anyone help me how to code this in SQL? Would be appreciated if code
> is included in the response
>
> Regards
>
> Fadi
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/79b8a25a-ce6b-4a73-9be2-d67c7d78e2ff%40googlegroups.com
> 
> .
>


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM10uV0Lfx2rAzFN3K95F-KwUC3TC5dsQvcehNpTtXYTwA%40mail.gmail.com.