Re: Random Tag

2005-12-02 Thread Tom Tobin
On 12/2/05, Tim Keating <[EMAIL PROTECTED]> wrote: > > -1 from me. As a *user*, I would much rather just generate random > content inside of my view code. I'm surprised this makes you -1 rather than -0; do you hate it that much? :-) > I'd like to point out the cited example > (random photo on F

Re: Caching Expression in Templates using a custom "Cache" Tag

2005-12-02 Thread Ian Holsman
hmm.. I wonder if there is a way for the django model API to do this automatically for you. and it would cache EVERYTHING for the given request. On 12/1/05, Eric Baker <[EMAIL PROTECTED]> wrote: > > I wrote a custom tag that allows you to cache an expression in a > template. > > I noticed, that

Re: Smarter cache

2005-12-02 Thread [EMAIL PROTECTED]
> > So, are you interested in PHP realization with main idea explained? > Yes Ok, hope it will be interesting: In my CMS there is (there was?) such an abstraction: node. Node - it's everything - it's a news, article or any other content unit. Node has all CRUD operations through the functions:

Re: Subquery support in DB lookup

2005-12-02 Thread oggie rob
I think the biggest criticism to an idea like this is that it introduces a lot of complexity without solving all the problems you need to solve. For example, what if you need to form a join with another table that goes beyond polls_choices. An alternative is to generate some other function that di

Re: Random Tag

2005-12-02 Thread Tim Keating
-1 from me. As a *user*, I would much rather just generate random content inside of my view code. I'd like to point out the cited example (random photo on Flickr) can't be done with this technique, since this is baked into the template.

Re: Parser pranks

2005-12-02 Thread Jacob Kaplan-Moss
On Dec 2, 2005, at 11:05 AM, pgross wrote: A bit off topic, but on our project, we run every parsed page through xmllint to verify that it is valid XHTML (validates against the XHTML DTD). If you can do the same functionality at the template layer (in DEBUG mode, of course), that would be reall

Re: Parser pranks

2005-12-02 Thread pgross
A bit off topic, but on our project, we run every parsed page through xmllint to verify that it is valid XHTML (validates against the XHTML DTD). If you can do the same functionality at the template layer (in DEBUG mode, of course), that would be really cool. Paul

Re: Database querying in Django

2005-12-02 Thread Brant Harris
On 12/1/05, Brant Harris <[EMAIL PROTECTED]> wrote: > Alright, I'll get up a ticket as soon as I can. > As promised: http://code.djangoproject.com/ticket/980 It explains not only the system but my reasoning.

Re: Database querying in Django

2005-12-02 Thread Amit Upadhyay
On 12/2/05, oggie rob <[EMAIL PROTECTED]> wrote: Yes, it is a little ugly. I would suggest that you put the Q argumentsoutside of your query for readability (also for those 'subqueries' youwere talking about):hello = Q(headline__startswith='Hello')bye = Q(headline__startswith='Goodbye') articles.ge

Re: save/delete/etc hooks for custom fields

2005-12-02 Thread Nebojša Đorđević - nesh
On 2005-12-02, at 8:54 CET, Nebojša Đorđević - nesh wrote: Well it can be a little less horrible if we use a decorator (2.4) syntax: Huh? Why this don't work: def thumbnail_cleanup(post_delete=None): def new_post_delete(self): from nesh.thumbnails.utils import remove_thumbnails

Re: SITE's -- an idea to make them transparent/easier to use

2005-12-02 Thread Andreas Stuhlmüller
On 11/23/05, Kevin <[EMAIL PROTECTED]> wrote: > > Ok, I jumped into Django's code and it seems that the where_constraints > is instead an array of sql strings, not the keyword mapping. > > so instead of: > where_constraints = {'online__exact: True} > you would need: > where_constraints = ['online