Programmaticly declaring Models and caching in Admin contrib

2011-04-17 Thread Yuka Poppe
Hi List, Maybe someone can hint me in the right direction with this. Im using Django backed by a non relational database, declaring my django models is enough in order to store and retrieve data, so I devised a design where models itself are declared by instantiating the metaclasses and using

Re: Using composition in Django

2011-04-16 Thread Yuka Poppe
Hi Guevara, Proxy models only inherit python logic, they are what you expect when you subclass a superclass; I dont think thats what you want in this case. I think you actually do want multi-table inheritence, im not too well educated in "design patterns" but i think thats what you mean by

Re: Put an "inline" at the top of admin form instead of bottom?

2011-04-16 Thread Yuka Poppe
Hi Jeff, I dont knw the details of the top of my head, but you could place inherit a changeform template dedicated for your specific app/model, and simply edit it to have the inline formsets on the top, or use a conditional template tag to display only one of your inline models at the top. I

Re: Python quit unexpectedly

2011-04-16 Thread Yuka Poppe
On Sat, Apr 16, 2011 at 6:17 PM, Hudar wrote: > Withouth grappeli, I can go to django admin page. But > after install grappelli, and try to access  http://127.0.0.1/admin/ > error appear 'Python quite unexpectedly'. Hello Hudar, It means python crashed, in general this

Re: base.html (extended by others) has to be in project (not app) root?

2011-04-14 Thread Yuka Poppe
Hi Jeff, I think Gladys is correct, the reason for your code finding the index template, is because its probably looking for 'myapp/index.html' instead of just 'index.html' Im not really sure if you're also distinguishing between the project template root and the app directory template dirs.

Re: Need straightforward way to pre-process form data

2011-04-14 Thread Yuka Poppe
this according to your needs just fine. Yuka On Thu, Apr 14, 2011 at 8:48 PM, Yuka Poppe <y...@xs4all.nl> wrote: > Hi Rick, > > Ok, I did a quick skim over the BaseForm; Validation is called by the > method is_valid(), which inturn accesses the property self.errors -- > And thus _get

Re: Need straightforward way to pre-process form data

2011-04-14 Thread Yuka Poppe
make it work.  And just I'm looking for a > simpler solution. > > Thanks, > Rick > > > > On Apr 14, 12:16 pm, Yuka Poppe <y...@xs4all.nl> wrote: >> On Thu, Apr 14, 2011 at 5:32 AM, ricksteu <rick_s...@yahoo.com> wrote: >> >> > Hello

Re: Need straightforward way to pre-process form data

2011-04-14 Thread Yuka Poppe
On Thu, Apr 14, 2011 at 5:32 AM, ricksteu wrote: > > Hello - > > I am looking for a straightforward way to alter posted form data prior > to when the form's full_clean() method is called.  Specifically, I > need to strip whitespace from any string data (such as for >

Re: get_object_or_404 Tutorial part 3

2011-04-13 Thread Yuka Poppe
> I believe that the cutoff is 512 bytes, but you may want to test in > different browsers to be sure. I suspected as much but wasnt quite sure, it didn't matter as much at the time I had to deal with it, and the problem went away by itself. None the less its nice to have this information

Re: referencing fields on the model without F()

2011-04-13 Thread Yuka Poppe
You could possibly resort to the extra() queryset method, allthough it eats raw sql, its documented in the manual. Im not sure if its in 0.96 though. -- Regards, Yuka On Wed, Apr 13, 2011 at 3:09 PM, Roman Klesel wrote: > Hello, > > I have an old version of django

Re: get_object_or_404 Tutorial part 3

2011-04-13 Thread Yuka Poppe
Dear darekodz, I noticed this myself a while back; It was'nt django specific, and I dont know about IE, I generally try to avoid using that; But in case of Chrome, whenever it encounters a 404 error (or certain other conditions) it seems to decide the visitor is better off being served a generic