Re: Template tag testing

2009-06-23 Thread brianmac44
On Jun 23, 12:00 pm, Michael <newmani...@gmail.com> wrote: > On Tue, Jun 23, 2009 at 11:53 AM, brianmac44 <brian@gmail.com> wrote: > I don't know if this is best practice, but here is the way I test my > template tags essentially by rendering the templates: >

Template tag testing

2009-06-23 Thread brianmac44
I tried to test template tags with doctests and unittests but I'm not sure what token and/or context to use. What's the best practice for testing template tags? Thanks, Brian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: S3Storage.py and Thumbnails using PIL (IOError / cannot identify image file)

2008-12-22 Thread brianmac44
got the same result with brianmac44's code. I also verified that the > my resize_image() works when opening the file from the local > filesystem - so I am somehow not passing the file in a manner that > Image.open likes. > > On Dec 22, 4:45 am, brianmac44 <anon1...@gmail.com> wrote: &g

Re: S3Storage.py and Thumbnails using PIL (IOError / cannot identify image file)

2008-12-22 Thread brianmac44
I had the same problem two weeks ago. This is what I wrote: def resize_photo(self,content,size): img = Image.open(ContentFile(content)) img.thumbnail(size, Image.ANTIALIAS) io = StringIO.StringIO() img.save(io, 'PNG') return ContentFile(io.getvalue()) Hope this helps.

Re: Nested for loops in template

2008-07-18 Thread brianmac44
ework yet, but from the looks of it I > believe that will work. > >   -- Scott > > > > On Fri, Jul 18, 2008 at 12:21 PM, brianmac44 <[EMAIL PROTECTED]> wrote: > > > Hi Scott, > > Thanks for your help, but I'm still having trouble. > > I using django-thre

Re: Nested for loops in template

2008-07-18 Thread brianmac44
et us have a look at > your entry and comment models (use dpaste.com) and we can help you figure > out exactly what to write. > >   -- Scott > > > > On Fri, Jul 18, 2008 at 11:47 AM, brianmac44 <[EMAIL PROTECTED]> wrote: > > > I have two tables, one is ent

Nested for loops in template

2008-07-18 Thread brianmac44
I have two tables, one is entries and the other is comments. In the template I would like display how many comments for each entry and some other entry data. So far I have... view: entries_list = entries.objects.filter( ...) template: {% for p in object_list %} {{