Re: Creating an object with a FileField programmatically

2009-04-26 Thread chachra
I am trying something similar and getting: Cannot create a consistent method resolution order (MRO) for bases File, FieldFile Using Django 1.1b Cheers! Sumit On Apr 14, 1:11 pm, Alex Gaynor wrote: > On Tue, Apr 14, 2009 at 4:04 PM, Vincent Foley wrote: > > > Hello, > > > I want to be able t

Design question: model functions / business logic / django admin

2009-04-07 Thread chachra
Hi, I have a basic design question. If I have a model say class Account(models.Model): users = models.ManyToManyField(User) def add_user(user): self.users.add(user) do_something_here() Now in my app code I always call add_user() to add a user to the account since do_something_her

Re: Strip empty lines in rendered templates?

2009-03-24 Thread chachra
Would the {% spaceless %} template tag be helpful here ? I posted a similar question, and someone responded saying that may be the way to go. Cheers! Sumit On Mar 16, 9:45 am, Benjamin Buch wrote: > Yes, you're right. > > But as the SpacelessMiddleware uses djangos' strip_spaces_between_tags,

Not executing all middlewares/context processors?

2009-03-21 Thread chachra
Hi, Sorry if this is a common question, my searches didn't lead to an answer! I developed an application, using context_processors, middlewares etc. Now I am trying to run a few other domains based on app config, say xyz.com. But I don't want all my app specific middlewares and context_processor

Re: Compressing templates

2009-03-20 Thread chachra
Excellent. This would work. Except that this work would have to be done on every page load, unless template (pre-rendered versions) get cached? Thanks! On Mar 20, 5:30 pm, Alex Gaynor wrote: > On Fri, Mar 20, 2009 at 8:28 PM, chachra wrote: > > > Agreed. I was just wondering if

Re: Compressing templates

2009-03-20 Thread chachra
rote: > On Fri, Mar 20, 2009 at 7:19 PM, chachra wrote: > > > Hi, > > > Sorry if this has been discussed before. I am minifying my js/css > > using a simply python script + yui compressor. > > > I would like to write a "deploy script" that takes all my

Compressing templates

2009-03-20 Thread chachra
Hi, Sorry if this has been discussed before. I am minifying my js/css using a simply python script + yui compressor. I would like to write a "deploy script" that takes all my code + removes all white spaces, newlines etc. from all my template (.html) files. This should help improve page loads +

Re: Paginator - JSON - Serializing related issue

2008-12-05 Thread chachra
Why don't you create a new list l = [] put the pagenumber etc. only a map and append to list Then iterate over your objects and append them too. Then use simplejson.dumps() and job done ? Works for me! Cheers! Sumit On Oct 20, 5:48 am, "H. de Vries" <[EMAIL PROTECTED]> wrote: > Hey Rajesh, >