On Mar 8, 10:09 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2007-03-08 at 04:09 -0800, Simon G. wrote: > > Good Evening Djuggernauts, > > > I've spent some time looking over the email related tickets in Trac, > > and think I've got them sorted out a bit. I'm hoping to spur some > > discussion on some of these, so here's a brief recap. > > Nice work, again, Simon.
Yes, good work! > > #3366 - objectify send_mass_mail parameters > > This aims to clean up the send_mass_mail arguments by plugging them > > into an object. This looks fairly sensible, and has a patch, but has > > some backwards incompat. issues. This needs a design decision - and if > > it's "yes", then the other tickets will probably need to be rewritten > > to take this into account. The send_mail() and send_mass_mail() could be re-implemented to maintain backwards compatibility. > If things like #1541 are deemed useful, this is a probably a good idea. > Particularly because so many of the arguments are optional. > > I'm not sure why Gary wants to use an object, rather than a dictionary, > since dictionaries are often easier to construct in client code if > you're doing it all in once place. There's also nothing really object-y > about the data: it's just a bag of name/value pairs. Using an object > makes using the values easier (foo.bar versus foo["bar"]), but creating > them is more verbose. I figured an object would be nice since we have a clump of related data and could have some nice methods for working with that data, like send(), add_attachment(), __str__(), etc. I had just written a lot of code that sent different emails and was getting fed up with all the tuples. A dictionary would be a little awkward since you don't exactly have required keys. Verboseness might be slightly increased, but so is readability and introspection. message = {'to': email_list, 'from': [EMAIL PROTECTED], 'subject': "Test", 'body': "hello world"} or message = EmailMessage(to=email_list, from='[EMAIL PROTECTED]', subject="Test", body="hello world) Criticism welcome. > The principle seems sound; we should decide about this pre-1.0. I asked Jacob to take a quick look at this ticket during the PyCon sprint. His comments were (1) the send method on EmailMessage is kinda neat and (2) we would need to keep send_mail() and send_mass_mail() functions around for backwards compatibility, but could deprecate them for 1.0. From my standpoint, however, he made no definite decision. > For my money, #3472 and #2897 look like important ones that need fixing > soon. #3366 looks like a good idea for period between 0.96 and 1.0 > because of the backwards-compat changes. For the rest, I'm willing to > defer to others, since I don't use them and so am probably being too > negative. I agree that #3472 and #2897 are probably the two most important. Other than that, I would like multipart and BCC capabilities because I think these have good use cases, like HTML+plaintext newsletters for example. Gary --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---