Re: EmailMessage mangles body text

2010-04-28 Thread Hanne Moa
On 28 April 2010 16:13, Vinay Sajip  wrote:
> On Apr 28, 1:11 pm, Hanne Moa  wrote:
>> the-real-solution-is-to-ditch-SMTP-ly yours,
>> HM, postmaster
>
> And your suggestion for a replacement would be ... what?

I would say it doesn't exist yet. Though, instant messaging is now so
common that *that* might take over, at least jabber can send to
offline users. Kids these days don't know what email is anyway, they
use SMS :/ (Yes, it leads to problems when they get employed.)


HM

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: managing javascript and css resources

2010-04-28 Thread Silvio
Consider taking a look at an app I wrote, 
http://www.sgawebsites.com/projects/django-aggregator/.

It aggregates all JS and CSS files using a very simple syntax. It can
also pipe the content through YUI Compressor before saving the
aggregate.
My aim was to make it extremely easy to use. It's not an asset manager
though; I've yet to see or come up with a great solution.

Regards,

Silvio

On Apr 23, 10:51 am, Owen Nelson  wrote:
> Kevin Howerton wrote:
> > The widget and admin media system needs to be re-evaluated IMO
> > none of these solutions are going to address the flaws you are
> > referring to.
>
> "Flaws", sounds a bit harsh :P  Let's alias that as "room for improvement".
> I'd agree that wrangling hashes and compressing assets at run-time is
> undesirable, and that a management command is preferable.
> There's a bit of conflict between what I crave, and the
> compress-everything-ahead-of-time tactic though.  Actually... I take
> that back - following Gabriel's train of though, we could probably have
> it both ways.
>
> Since my goals are somewhat smaller (in some ways), I've started
> thinking about ways to implement what I want (some kind of "global"
> stack of client-side resources) that won't require sticking my fingers
> in the django source.  At least not yet.
> Here's kind of what I'm thinking about:http://dpaste.org/Pjk5/
> (Sorry, the naming is all a bit clunky - that was just off the top of my
> head)
>
> Extending something simple like that with some template tags, and
> stringing it all together with some middleware.
> This would give us a way to pool scripts together under one framework
> instance, also allowing us to dynamically add (from views and templates)
> them to the framework container throughout the life cycle of a request
> and response.
> I think I might be able to run some tests in a custom app - then start
> experimenting with the admin site.
>
> Once I've got all that setup, it should be a snap to add
> compression/concatenation somewhere along the  pipeline, either at
> runtime or via a management command.
>
> Obviously, this is all very jQuery specific (where most of my javascript
> experience lies).  I'd love to hear from someone on team dojo,
> prototype, yui, or extjs to learn about what doesn't fit with this model.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To post to this group, send email to django-develop...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-developers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Django unit test coverage

2010-04-28 Thread Gabriel Hurley
One of the GSOC projects that was accepted is about updating and
improving Django's test suite. The guy doing it has expressed interest
in using coverage.py to help with the project (whether as a long-term
part of django or just for the GSOC project), so there'll probably be
more concrete information available in a few months...

All the best,
- Gabriel

On Apr 28, 8:36 am, Vinay Sajip  wrote:
> Can someone please point me to any information about stats on coverage
> of Django's own code by its unit tests? I searched for "Django test
> coverage" and "test coverage site:djangoproject.com" but I'm getting
> pages about testing code which uses Django using Django's test
> infrastructure, and I couldn't spot anything which refers to coverage
> of Django's own code. If I've missed something blindingly obvious,
> sorry for the bother, but a pointer would be appreciated!
>
> Regards,
>
> Vinay Sajip
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To post to this group, send email to django-develop...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-developers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: EmailMessage mangles body text

2010-04-28 Thread Ian Clelland
On Wed, Apr 28, 2010 at 10:00 AM, Rob Hudson  wrote:

> On Tue, Apr 27, 2010 at 6:38 PM, Leo  wrote:
> > Digging deep into Python's innards reveals that this is a somewhat
> > esoteric protection in case you're writing out Unix mailbox files. The
> > specific issue is here:
> http://docs.python.org/release/2.6.2/library/email.generator.html#email.generator.Generator
> > and involves the mangle_from_ flag.
> >
> > The hugely more likely case is that if you're using Django's
> > EmailMessage class you're sending emails rather than writing Unix
> > mailbox files and are running into this bug that way.
>
> Wouldn't these e-mails end up on other servers that might save the
> message in a Unix mailbox format?  And if so, wouldn't removing the
> ">" from the "From" cause problems?
>

No, the issue is only for message storage, not transmission -- there's
nothing in SMTP that says you need to escape From_ lines. If those servers
need to store the message in a Unix mbox, they will escape it on their own.
(In fact, if the message contains a line starting with >From, I'm pretty
sure they will need to further escape it, storing it as >>From)

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: EmailMessage mangles body text

2010-04-28 Thread Tom Evans
On Wed, Apr 28, 2010 at 6:00 PM, Rob Hudson  wrote:
> Wouldn't these e-mails end up on other servers that might save the
> message in a Unix mailbox format?  And if so, wouldn't removing the
> ">" from the "From" cause problems?
>
> -Rob

No - not unless the local MTA cannot handle storing messages in mbox
format if they have a line that starts with 'From'.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: EmailMessage mangles body text

2010-04-28 Thread Rob Hudson
On Tue, Apr 27, 2010 at 6:38 PM, Leo  wrote:
> Digging deep into Python's innards reveals that this is a somewhat
> esoteric protection in case you're writing out Unix mailbox files. The
> specific issue is here: 
> http://docs.python.org/release/2.6.2/library/email.generator.html#email.generator.Generator
> and involves the mangle_from_ flag.
>
> The hugely more likely case is that if you're using Django's
> EmailMessage class you're sending emails rather than writing Unix
> mailbox files and are running into this bug that way.

Wouldn't these e-mails end up on other servers that might save the
message in a Unix mailbox format?  And if so, wouldn't removing the
">" from the "From" cause problems?

-Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: EmailMessage mangles body text

2010-04-28 Thread Leo
The patch is done and attached to the ticket. I also had to clean up
the doctest for django.core.mail a bit. Some of them were not working
as intended since they didn't use the  syntax in their
expected output. I suspect that issue exists in other doctests but I'm
not volunteering to go fix them all, just something to be aware of :-)

--
--Leo

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Django unit test coverage

2010-04-28 Thread Jeremy Dunck
There's an open ticket on it, though no progress recently.
http://code.djangoproject.com/ticket/4501

http://groups.google.com/group/django-developers/browse_thread/thread/7e4dae3534c8a8c3/5d49f4d17cb1bed0

George Song's project:
http://opensource.55minutes.com/trac

On Wed, Apr 28, 2010 at 10:36 AM, Vinay Sajip  wrote:
> Can someone please point me to any information about stats on coverage
> of Django's own code by its unit tests? I searched for "Django test
> coverage" and "test coverage site:djangoproject.com" but I'm getting
> pages about testing code which uses Django using Django's test
> infrastructure, and I couldn't spot anything which refers to coverage
> of Django's own code. If I've missed something blindingly obvious,
> sorry for the bother, but a pointer would be appreciated!
>
> Regards,
>
> Vinay Sajip
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To post to this group, send email to django-develop...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-developers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Django unit test coverage

2010-04-28 Thread Vinay Sajip
Can someone please point me to any information about stats on coverage
of Django's own code by its unit tests? I searched for "Django test
coverage" and "test coverage site:djangoproject.com" but I'm getting
pages about testing code which uses Django using Django's test
infrastructure, and I couldn't spot anything which refers to coverage
of Django's own code. If I've missed something blindingly obvious,
sorry for the bother, but a pointer would be appreciated!

Regards,

Vinay Sajip

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: EmailMessage mangles body text

2010-04-28 Thread Leo
Thanks Russ!

>>> My only question is whether overriding __str__ is the right
>>> place; given that as_string() is the affected interface, it seem like
>>> that should be the method that is fixed.

It looks like you're right. as_string() is the right method to
override. I'll put a patch together.

> I'm sure this particular bug is annoying in your
> particular case, but there are plenty of annoying edge case bugs in
> Trac that are annoying to various people. Unfortunately, if we're
> *ever* going to release 1.2, we need to draw the line somewhere.

No worries, I just figured it couldn't hurt to ask.

> However, if you get a patch worked up, this could be a very early
> commit in the 1.3 timeframe.

I'll put a patch together, but I'd happily trade the 'get an early
commit into 1.3' card in for http://code.djangoproject.com/ticket/11716
- IMO that one's a much bigger deal :-)

--
--Leo

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: format/input_format on timefield

2010-04-28 Thread Gary Bernard

yes ...sorry. saw that after I posted...

Gary Bernard

Bernard Design

232 E 33rd Place
Tulsa, OK 74105

918-629-1932
918-749-0075 (fax - please call first)

g...@bernarddesign.com

http://bernarddesign.com










On Apr 28, 2010, at 9:38 AM, Karen Tracey wrote:

The topic of this list is the development of Django itself:  
questions about how to use Django should be directed to django-users.


Karen

--
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 django-developers+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en 
.


--
You received this message because you are subscribed to the Google Groups "Django 
developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: format/input_format on timefield

2010-04-28 Thread Karen Tracey
The topic of this list is the development of Django itself: questions about
how to use Django should be directed to django-users.

Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: EmailMessage mangles body text

2010-04-28 Thread Vinay Sajip
On Apr 28, 1:11 pm, Hanne Moa  wrote:
> the-real-solution-is-to-ditch-SMTP-ly yours,
> HM, postmaster

And your suggestion for a replacement would be ... what?

Regards,

Vinay Sajip

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



format/input_format on timefield

2010-04-28 Thread Gary b
I am having trouble being able to get format or input_format to work
properly on a form TimeField/TimeInput and wanted to check to see if
anyone has ever come across this. I have a form built using ModelForm
which has a class_time field. I am trying to allow entries into the
timefield such as 4 p.m. or 10:30 a.m. rather than using the 24-hour
clock that is the default %H:%M:%S - which is all I have been able to
get working.

Below is the definition of the class_time field in my forms.py file:

class_time = forms.TimeField(widget=forms.TimeInput(format='%h:%i
%a'), error_messages={'required' : 'Please enter a time.', 'invalid' :
'Please enter a properly formatted.'})

Isn't that all I should need to do? Am I missing something? Is there
some work around? Has input_formats super-ceded the format
declaration? Doesn't seem to matter as I have gotten neither to work
as expected.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: EmailMessage mangles body text

2010-04-28 Thread Russell Keith-Magee
On Wed, Apr 28, 2010 at 1:52 PM, Leo  wrote:
>> This is the sort of bug that makes me want to give up my material
>> possessions and go live in a cave somewhere. Ugh.
>
> You can imagine the fun we had tracking it down throughout the stack
> trying to isolate the error case. It made me want to throw my hands up
> and declare that programming is just too hard for humans and we should
> go back to the abacus.
>
>> It's not pretty, but I really don't see much of an alternative,
>> either. My only question is whether overriding __str__ is the right
>> place; given that as_string() is the affected interface, it seem like
>> that should be the method that is fixed. However, that's just based on
>> an initial inspection; I'm willing to be convinced that I'm wrong on
>> that one.
>
> My initial gut reaction was to edit __str__ precisely for that reason
> since clients would have an expectation for a custom string
> representation method, but I don't have strong feelings about it at
> all. Let me dig into it a little bit and see if I can figure out
> what's using it and which one might be best  to override. If I can get
> a good patch together quickly, any chance it might go into 1.2?

At this point, we're only looking for bugs that cause catastrophic
data loss, or represent significant flaws in new features. In this
case, the bug has existed for a long time, and this is the first time
it's been noticed. I'm sure this particular bug is annoying in your
particular case, but there are plenty of annoying edge case bugs in
Trac that are annoying to various people. Unfortunately, if we're
*ever* going to release 1.2, we need to draw the line somewhere.

However, if you get a patch worked up, this could be a very early
commit in the 1.3 timeframe.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: EmailMessage mangles body text

2010-04-28 Thread Hanne Moa
On 28 April 2010 03:38, Leo  wrote:
> This is a fun one.

A bit like finding fossils, methinks.

> The message that appears on the other end has this in the body:
>
> >From puppies
>
> A From at the beginning of any lines in the body gets a > prepended to
> it.

The reason this exists at all is of course because once upon a time,
email was stored on disk in the mbox format, several messages per
file, and a new message started with 'From ' at the start of the line
meaning that 'From ' as the start of the line in message contents
therefore had to be escaped somehow. Just to be safe, many
mail-systems still do so even if they no longer use mbox. This problem
*will* sooner or later bite anyone who touches an email system, it is
as inevitable as earthquakes.


the-real-solution-is-to-ditch-SMTP-ly yours,
HM, postmaster

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.