#17193, Mass Templated Emails and support for mass EmailMessage (s)

2021-03-21 Thread Muskan Vaswan
I came across this issue #17193 which is quite old, that I'd like 
clarification/discussion on. 
To summarize the discussion that took place there 
 as well as from an older 
discussion 

:
 The ticket was raised in hopes of allowing the sending of mail from a 
template without having to use the roundabout of the 'render_to_string' 
method before the "html_message" attribute was added to send_mail and 
EmailMessage. After this attribute was added, the discussion was that the 
use cases for this template format were even more reduced and that 
implementing it through a third-party package would perhaps be more elegant.

Consider the following use case: You have a student lifecycle management 
system in which you need to send the same circular to all students and 
parents fitting certain criteria, with only a few changes such as name, 
class, etc. 
In this particular scenario, you would send a  templated email to a lot of 
people, or, in other words, a mass templated email with only the context 
and recipient changing. While third party packages could accomplish this 
one way or another, it is my opinion that a more elegant solution could be 
provided by Django. 
Considering, that this sort of situation seems quite likely to arise, and 
the age of this ticket, I wonder if there has been any development in this 
area since, which I could not find in my own research on this issue. If so 
I would appreciate it if you could point me in the correct direction. 
If not, I would like to open discussion for potential solutions to this.
If this is finally deemed unnecessary, it becomes a simple matter of 
closing the ticket.


In relevance to this, even in the absence of support for TemplatedMails, it 
perhaps would be useful to allow sending mass emails while also allowing 
the usage of the EmailMessage format of more descriptive emails. This might 
be accomplished by allowing a list of EmailMessage objects in the helper 
function "send_mass_mail" or maybe by creating a new EmailMessages object 
to do this. 

Would appreciate your input on this.

Regards
Muskan Vaswan


-- 
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/9e7d10ee-6492-4430-a963-7ceb632fe928n%40googlegroups.com.


Let's simplify coding with html

2021-03-21 Thread manasdeep borole
Hi Everyone,
I know coding could get tough sometimes(experienced it).
But thanks to amazing people like you and per built framework like Django.
At least not everyone has to know everything now.
The Open Source support is amazing as well.
Thanks a lot.

Last time while working with html I was annoyed by the syntax. 
You have to deal with so many end tags they tend to confuse you.
eg 

NOW...




this is most inner class

this is quite outer class

this is most outer class


With Improvement

div class='upper':
div class='middle':
div class='lower':
"this is most inner class
 "this is quite outer class"
"this most outer class"

advantages:

   1. Python like indentation
   2. simple to read (developer/debugger friendly)
   3. 50% lowers the chances of mistake while coding (most errors happen 
   because coders forget end tags with html)
   4. no end tags required
   5. supports python based logic building like use of for, if
   6. programers are free to let computer do the repetitive tasks like 
   logic based id for multiple div with similar functionality 
   7. plans to support direct support for bootstrap( working on it)


disadvantages:

   1. needs time and effort to build such a system
   2. expert support and guidance may be needed
   3. adoption time and some effort on part of programmers 

If someone could mentor me I am willing to build on this Idea
Actually I have built a basic version.
I understand you would have a lot of requests for GSOC application.
Can someone guide me if this Idea could be made into a GSOC proposal.
If you have any suggestion or ideas to make this project better you are 
most welcome.
Thank you 
For your 'time' and 'consideration'



-- 
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/024e7422-8242-497c-9a32-f5b67b4fcae3n%40googlegroups.com.


Re: Help with implementing calculated fields (#28822)

2021-03-21 Thread Tobias Bengfort

Hi Matt,

sorry for the late reply. This is exactly what I was looking for!

However, if I understand correctly this is more a proof of concept and 
not ready for production use. There still seem to be some subtlties that 
need to be fixed:


- related queries with shared_property
- filtered aggregates (e.g. Max('name', filter=Q(…)) in related queries 
with ComputedField (Q object would need similar processing to F objects)
- group_by with both implementations (I get "aggregate functions are not 
allowed in the GROUP BY clause")


Other than that it is great to see this is possible as a third party 
library. I am still not sure how much interest there actually is though.


tobias

PS: There is a small typo in the first link in your blog post.


On 15/03/2021 04.49, schinckel wrote:

Hi Tobias.

I've done a bit of stuff on this, and found there were actually limited 
changes that need to be made to django to got this to work.


https://schinckel.net/2020/09/15/django-properties-from-expressions%2C-or-computedfield-part-2/

I haven't touched it much since then (although I'm keen to revisit it, 
actually), but it's actually possible that we can do it without any 
changes to Django.


https://github.com/schinckel/django-shared-property

Matt.

On Sunday, March 14, 2021 at 11:46:15 PM UTC+10:30 Tobias Bengfort wrote:

Hi,

a while back there has been a discussion about calculated model fields:

https://groups.google.com/g/django-developers/c/ADSuUUuZp3Q/m/5o02Lp_jCwAJ



The main benefit would be that these would be available in cases where
annotations are currently not available, e.g. related queries or admin
lists (see #14336).

Note that the topic of fields that have both a DB and python
implementation was discussed and the consensus was that the python
equivalents could be added by a separate library, if required. So I am
only talking about the database part here.

The linked discussion was mainly about *what* is desired, not *how* it
could be done. I also noticed that the fellows did not participate in
that discussion.

I would like to have a shot at this topic. So I am interested in:

- Do you think this is even possible/worth the effort?
- How could this be implemented and what would be potential challenges?
- Is it possible to implement this in a third party library or does it
require changes to django itself?

I would probably start with a non-editable, non-concrete model field
(similar to GenericForeignKey or ForeignObjRel). But I have no clue yet
how to integrate that with QuerySet/Query.

thanks
tobias

--
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/8d325f4e-9c20-4268-9c46-6f682911ac5dn%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/bf68d4a3-dcbc-a411-66cd-2197bc53b0ba%40posteo.de.


Re: Let's simplify coding with html

2021-03-21 Thread Aymeric Augustin
Hello,

There are several projects providing alternate syntax for generating HTML, 
along the lines of your suggestion, and other projects for integrating these 
with Django. Here's one such project: https://github.com/nyaruka/django-hamlpy 
. I believe we're happy with this 
functionality being provided by third-party projects. As a consequence this 
doesn't seem likely to be accepted for GSoC.

-- 
Aymeric.



> On 21 Mar 2021, at 17:08, manasdeep borole  wrote:
> 
> Hi Everyone,
> I know coding could get tough sometimes(experienced it).
> But thanks to amazing people like you and per built framework like Django.
> At least not everyone has to know everything now.
> The Open Source support is amazing as well.
> Thanks a lot.
> 
> Last time while working with html I was annoyed by the syntax. 
> You have to deal with so many end tags they tend to confuse you.
> eg 
> 
> NOW...
> 
> 
> 
> 
> this is most inner class
> 
> this is quite outer class
> 
> this is most outer class
> 
> 
> With Improvement
> 
> div class='upper':
> div class='middle':
> div class='lower':
> "this is most inner class
>  "this is quite outer class"
> "this most outer class"
> 
> advantages:
> Python like indentation
> simple to read (developer/debugger friendly)
> 50% lowers the chances of mistake while coding (most errors happen because 
> coders forget end tags with html)
> no end tags required
> supports python based logic building like use of for, if
> programers are free to let computer do the repetitive tasks like logic based 
> id for multiple div with similar functionality 
> plans to support direct support for bootstrap( working on it)
> 
> disadvantages:
> needs time and effort to build such a system
> expert support and guidance may be needed
> adoption time and some effort on part of programmers 
> If someone could mentor me I am willing to build on this Idea
> Actually I have built a basic version.
> I understand you would have a lot of requests for GSOC application.
> Can someone guide me if this Idea could be made into a GSOC proposal.
> If you have any suggestion or ideas to make this project better you are most 
> welcome.
> Thank you 
> For your 'time' and 'consideration'
> 
> 
> 
> 
> -- 
> 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/024e7422-8242-497c-9a32-f5b67b4fcae3n%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/F7ED4035-51FD-4F64-AB3C-791C57C83B8F%40polytechnique.org.


Re: Proposal to add attribute 'step' to FloatField and DecimalField

2021-03-21 Thread Kapil Bansal
Hi everyone,
I am working on this and I have a question.
How to write validation check for this?
Due to python floating point issues, I am not able to validate whether 
field value is of given step_size or not

- Kapil
On Wednesday, March 17, 2021 at 9:34:59 PM UTC+5:30 jacob...@gmail.com 
wrote:

> Great News!
> So please accept ticket #32559 
> . I then will assign myself 
> to it and implement it.
> So I add step (or would you prefer step_value?) to IntegerField and 
> FloatField, but not to DecimalField (because there it's handled through 
> decimal_places).
>
>

-- 
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/cc31eb05-4ec4-4233-a535-ca8726156a35n%40googlegroups.com.


Re: Proposal to add attribute 'step' to FloatField and DecimalField

2021-03-21 Thread Jacob Rief
Say, you have a value and step, both are floats, then if value / step is 
can be represented
integer, the validation is fulfilled. Otherwise if the result has to be 
rounded to become an integer,
a ValidationError shall be raised.
Be aware of rounding errors.

On Sunday, March 21, 2021 at 9:53:43 PM UTC+1 kapilbansal...@gmail.com 
wrote:

> Hi everyone,
> I am working on this and I have a question.
> How to write validation check for this?
> Due to python floating point issues, I am not able to validate whether 
> field value is of given step_size or not
>

-- 
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/11953496-ad4c-49cd-857d-e8723692197bn%40googlegroups.com.


Re: Let's simplify coding with html

2021-03-21 Thread manasdeep borole
Thanks
But it seems there is no support for bootstrap (at least not directly)
Or may be I am missing something
Please feel free to point out...

On Mon, Mar 22, 2021 at 1:51 AM Aymeric Augustin <
aymeric.augus...@polytechnique.org> wrote:

> Hello,
>
> There are several projects providing alternate syntax for generating HTML,
> along the lines of your suggestion, and other projects for integrating
> these with Django. Here's one such project:
> https://github.com/nyaruka/django-hamlpy. I believe we're happy with this
> functionality being provided by third-party projects. As a consequence this
> doesn't seem likely to be accepted for GSoC.
>
> --
> Aymeric.
>
>
>
> On 21 Mar 2021, at 17:08, manasdeep borole 
> wrote:
>
> Hi Everyone,
> I know coding could get tough sometimes(experienced it).
> But thanks to amazing people like you and per built framework like Django.
> At least not everyone has to know everything now.
> The Open Source support is amazing as well.
> Thanks a lot.
>
> Last time while working with html I was annoyed by the syntax.
> You have to deal with so many end tags they tend to confuse you.
> eg
>
> NOW...
>
> 
> 
> 
> this is most inner class
> 
> this is quite outer class
> 
> this is most outer class
> 
>
> With Improvement
>
> div class='upper':
> div class='middle':
> div class='lower':
> "this is most inner class
>  "this is quite outer class"
> "this most outer class"
>
> advantages:
>
>1. Python like indentation
>2. simple to read (developer/debugger friendly)
>3. 50% lowers the chances of mistake while coding (most errors happen
>because coders forget end tags with html)
>4. no end tags required
>5. supports python based logic building like use of for, if
>6. programers are free to let computer do the repetitive tasks like
>logic based id for multiple div with similar functionality
>7. plans to support direct support for bootstrap( working on it)
>
>
> disadvantages:
>
>1. needs time and effort to build such a system
>2. expert support and guidance may be needed
>3. adoption time and some effort on part of programmers
>
> If someone could mentor me I am willing to build on this Idea
> Actually I have built a basic version.
> I understand you would have a lot of requests for GSOC application.
> Can someone guide me if this Idea could be made into a GSOC proposal.
> If you have any suggestion or ideas to make this project better you are
> most welcome.
> Thank you
> For your 'time' and 'consideration'
>
>
>
>
> --
> 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/024e7422-8242-497c-9a32-f5b67b4fcae3n%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/F7ED4035-51FD-4F64-AB3C-791C57C83B8F%40polytechnique.org
> 
> .
>

-- 
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%2BFa1GVNOQx79VaHwTOZcBAmvtQKmBOCFTE%3Dfh4k86H1rO7pNQ%40mail.gmail.com.