Django bugfix releases: 2.2.5, 2.1.12, and 1.11.24

2019-09-02 Thread Mariusz Felisiak

Details are available on the Django project weblog:

https://www.djangoproject.com/weblog/2019/sep/02/django-bugfix-releases-225-2112-11124/

--
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/9055a2a0-13a5-c53f-d4c3-c3023ae134fc%40gmail.com.


Re: Add support for multiple path converters on urls.path()

2019-09-02 Thread Marco Silva
Hey,

Thank you for your feedback.

Making a new URL definition is a good approach, even though the example I 
gave would require a few extra lines, that may be more readable than 
squeezing everything together.

Regarding the custom converter, I already have custom converters in place, 
and I don't think making a new one for every combination would be better, 
my initial goal was to reuse those converters as they can be properly 
tested.

Anyway, multiple url definitions it is, thank you all again.



On Saturday, August 31, 2019 at 10:32:35 AM UTC+1, Adam Johnson wrote:
>
> Hi Marco,
>
> Thanks for writing a clear, short proposal.
>
> This could be neat, but I'm against it for these reasons:
>
>- It's extra syntax - the advantage of the new URL syntax is that it's 
>very simple and easy to pick up. It's copied from Flask, which also 
> doesn't 
>support a "multiple converter" syntax  ( 
>https://flask.palletsprojects.com/en/1.1.x/quickstart/#routing ). 
>Instead, you're expected to define multiple routes if that's what you want.
>- It is only a shortcut - the behaviour you want can be achieve with 
>multiple URL definitions. This is clearer in terms of readability and 
>precedence (top to bottom). Understanding precedence could be a problem in 
>particular for a multi-converter pattern like "//" - 
>does "int a, str b" have precedence over "str a, int b", or the other way 
>round?
>- You can define a custom converter right now, as Richard suggests.
>
> Thanks for taking the time to write to the mailing list though,
>
> Adam
>
> On Fri, 30 Aug 2019 at 18:30, Richard  > wrote:
>
>> A possibility without changes to Django is to create a generic converter 
>> and apply it to each model:
>>
>> class ModelUUIDConverter:
>>regex= r'[a-fA-F0-9]{32}'
>>def __init__(self, model):
>>self.model = model
>>def to_python(self, value):
>>  return self.model.objects.filter(Q(uuid=value)|Q(display_id=value).
>> get()
>>def to_url(self,value):
>>  return str(value)
>>
>> urls.register_converter(lambda: ModelUUIDConverter(TicketModel), 
>> 'ticket_or_uuid')
>>
>> path('api/',TicketDetailView.as_view())
>>
>>
>>
>> On Friday, 30 August 2019 11:12:08 UTC-6, Marco Silva wrote:
>>>
>>> Hello,
>>>
>>> I'm on the process of migrating an app to django >2 and walked into this 
>>> potencial new feature while converting the URLs.
>>>
>>> Some modeles use a "display" id, like TICKET-2019-002, but it's pk is 
>>> actually a uuid, so the url would ideally support both.
>>>
>>> I've created a custom converter to verify the correct value, therefore I 
>>> can use:
>>> `path('api/ticket/', TicketDetailView.as_view())`
>>>
>>> but if i want to also expose the api with the uuid, I have to add 
>>> another urlpattern with:
>>> `path('api/ticket/', TicketDetailView.as_view())`
>>>
>>> my proposal would be to add support for this:
>>> `path('api/ticket/', TicketDetailView.as_view())`
>>>
>>>
>>> The concrete example is a different use case, its a "common" view where 
>>> you must specify the type first, so basically:
>>> `path('api///assign', 
>>> GenericAssignView.as_view())`
>>>
>>>
>>> From what i've seen on the API, wouldn't be much work to add regex 
>>> groups on the djanjo.urls.resolvers._route_to_regex method, but it also 
>>> returns a converters dictionary with a mapping of parameters(the ticket, or 
>>> refecence_nr) with a single converter, and that could cause problems 
>>> somewhere...
>>>
>> -- 
>> 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-d...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/d7cb9137-98bf-4db0-993b-538000321c65%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/8bb84ddf-cd1d-4461-92d7-fb7fc601a4d4%40googlegroups.com.


Clean Architecture in Django

2019-09-02 Thread Uzama Zaid
Hello Guys,

I would like to know any resources available on writing Django application 
in Clean Architecture.
Clean Architecture 


-- 
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/73fb8908-43cd-4e24-a9cd-12f80fedb74f%40googlegroups.com.


calculating two integers fields in django..

2019-09-02 Thread Muhammed Bilal


I have a model some thing like this

class Add(models.Model):
   Budget = models.IntegerField()
   Expense = models.IntegerField()

Now I would like to do calculations for example   Sum , subtracting two 
fields and multiplying them   (*budget - Expense) ..  
(**budget 
+ Expense)   (**budget * Expense)kindly help me . *

-- 
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/ed230914-03be-4de2-b626-315a86edadea%40googlegroups.com.


Re: calculating two integers fields in django..

2019-09-02 Thread Uzama Zaid
You can use methods to do that

On Mon, Sep 2, 2019 at 7:10 PM Muhammed Bilal  wrote:

>
> I have a model some thing like this
>
> class Add(models.Model):
>Budget = models.IntegerField()
>Expense = models.IntegerField()
>
> Now I would like to do calculations for example   Sum , subtracting two
> fields and multiplying them   (*budget - Expense) ..
> (**budget + Expense)   (**budget * Expense)kindly help me . *
>
> --
> 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/ed230914-03be-4de2-b626-315a86edadea%40googlegroups.com
> 
> .
>
-- 
Best Regards,

MJU ZAID
Student (2016 batch)
Department of Computer Science & Engineering
University of Moratuwa

-- 
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/CADKnJ4NJFi214hC1spWTd%2B0gRCWb%3DfSukYWHb%3D1ptjLxSz1Tbg%40mail.gmail.com.


Re: calculating two integers fields in django..

2019-09-02 Thread Manoj Jadhav Patil
If you are using MySQL. You can use virtual fields option.


Regards,
Manoj

On Mon, Sep 2, 2019, 9:20 PM Uzama Zaid  wrote:

> You can use methods to do that
>
> On Mon, Sep 2, 2019 at 7:10 PM Muhammed Bilal  wrote:
>
>>
>> I have a model some thing like this
>>
>> class Add(models.Model):
>>Budget = models.IntegerField()
>>Expense = models.IntegerField()
>>
>> Now I would like to do calculations for example   Sum , subtracting two
>> fields and multiplying them   (*budget - Expense) ..
>>   (**budget + Expense)   (**budget * Expense)kindly help me . *
>>
>> --
>> 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/ed230914-03be-4de2-b626-315a86edadea%40googlegroups.com
>> 
>> .
>>
> --
> Best Regards,
>
> MJU ZAID
> Student (2016 batch)
> Department of Computer Science & Engineering
> University of Moratuwa
>
> --
> 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/CADKnJ4NJFi214hC1spWTd%2B0gRCWb%3DfSukYWHb%3D1ptjLxSz1Tbg%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/CA%2BQ79bxzKCFiek8%3DFpj2F%2BcWd%2BzmbfpEybxvNpLCTxWTc1qwhQ%40mail.gmail.com.


Re: calculating two integers fields in django..

2019-09-02 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.

Thanks for your understanding,

Adam

On Mon, 2 Sep 2019 at 16:54, Manoj Jadhav Patil 
wrote:

> If you are using MySQL. You can use virtual fields option.
>
>
> Regards,
> Manoj
>
> On Mon, Sep 2, 2019, 9:20 PM Uzama Zaid 
> wrote:
>
>> You can use methods to do that
>>
>> On Mon, Sep 2, 2019 at 7:10 PM Muhammed Bilal  wrote:
>>
>>>
>>> I have a model some thing like this
>>>
>>> class Add(models.Model):
>>>Budget = models.IntegerField()
>>>Expense = models.IntegerField()
>>>
>>> Now I would like to do calculations for example   Sum , subtracting two
>>> fields and multiplying them   (*budget - Expense) ..
>>>   (**budget + Expense)   (**budget * Expense)kindly help me . *
>>>
>>> --
>>> 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/ed230914-03be-4de2-b626-315a86edadea%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> Best Regards,
>>
>> MJU ZAID
>> Student (2016 batch)
>> Department of Computer Science & Engineering
>> University of Moratuwa
>>
>> --
>> 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/CADKnJ4NJFi214hC1spWTd%2B0gRCWb%3DfSukYWHb%3D1ptjLxSz1Tbg%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/CA%2BQ79bxzKCFiek8%3DFpj2F%2BcWd%2BzmbfpEybxvNpLCTxWTc1qwhQ%40mail.gmail.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/CAMyDDM0JatrGeJBd2Lr_61mDhwfJun6eSxWScEGCTDUn8_9UVw%40mail.gmail.com.


Re: Clean Architecture in Django

2019-09-02 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.

Thanks for your understanding,

Adam

On Mon, 2 Sep 2019 at 14:23, Uzama Zaid  wrote:

> Hello Guys,
>
> I would like to know any resources available on writing Django application
> in Clean Architecture.
> Clean Architecture
> 
>
> --
> 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/73fb8908-43cd-4e24-a9cd-12f80fedb74f%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/CAMyDDM1TmcWXNmMdZADs9r2bjxBALkNG2iBRAb7p00yrAKSMRg%40mail.gmail.com.


Re: Clean Architecture in Django

2019-09-02 Thread Uzama Zaid
Noted with thanks

On Mon, Sep 2, 2019 at 10:14 PM Adam Johnson  wrote:

> 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.
>
> Thanks for your understanding,
>
> Adam
>
> On Mon, 2 Sep 2019 at 14:23, Uzama Zaid 
> wrote:
>
>> Hello Guys,
>>
>> I would like to know any resources available on writing Django
>> application in Clean Architecture.
>> Clean Architecture
>> 
>>
>> --
>> 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/73fb8908-43cd-4e24-a9cd-12f80fedb74f%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/CAMyDDM1TmcWXNmMdZADs9r2bjxBALkNG2iBRAb7p00yrAKSMRg%40mail.gmail.com
> 
> .
>
-- 
Best Regards,

MJU ZAID
Student (2016 batch)
Department of Computer Science & Engineering
University of Moratuwa

-- 
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/CADKnJ4PDWzWhCJu4H9sp6Y4Kz2Q_GkBkuxGNDksH752aysCrwQ%40mail.gmail.com.