Re: Feature request - set variables in template

2010-08-26 Thread Russell Keith-Magee
On Fri, Aug 27, 2010 at 9:27 AM, Brian O'Connor wrote: > I think this got brought up in the forums a month or so ago, but I'd like to > see a 'shortcut' for setting variables much like we have a shortcut for > registering inclusion templatetags.  Having to write a full fledged > templatetag to set

Re: Feature request - set variables in template

2010-08-26 Thread Mike Axiak
Perhaps you should ask django-users (or the IRC channel, #django, or stackoverflow, ...), how they would approach solving your particular problem. I know that for me it took a few months before I realized how perfect writing custom template tags (or template inclusion tags) are for many blocks of

Re: Feature request - set variables in template

2010-08-26 Thread Russell Keith-Magee
On Fri, Aug 27, 2010 at 9:22 AM, Yo-Yo Ma wrote: > I see what you're saying Russell. I myself am reluctant to use the > template tag I created in some ways. Although I cannot seem to find a > DRY way of doing what I'm doing Factor the logic out of your template so that your template is just descr

Re: Feature request - set variables in template

2010-08-26 Thread Brian O'Connor
I think this got brought up in the forums a month or so ago, but I'd like to see a 'shortcut' for setting variables much like we have a shortcut for registering inclusion templatetags. Having to write a full fledged templatetag to set a variable is a bit much. Brian On Thu, Aug 26, 2010 at 9:22

Re: Feature request - set variables in template

2010-08-26 Thread Yo-Yo Ma
I see what you're saying Russell. I myself am reluctant to use the template tag I created in some ways. Although I cannot seem to find a DRY way of doing what I'm doing, the idea of breaking the dogma does bother me a bit. I thought that if I could get confirmation from the crowds, it would make me

Re: get_next_by_FOO allows nulls

2010-08-26 Thread Russell Keith-Magee
On Fri, Aug 27, 2010 at 9:12 AM, Russell Keith-Magee wrote: > On Fri, Aug 27, 2010 at 2:12 AM, Carl Karsten wrote: >> I would like to discus my patch to add support of nullable fields to >> get_next_by_FOO >> >> http://code.djangoproject.com/ticket/13611 >> >>> You say "we" discussed this on IRC,

Re: get_next_by_FOO allows nulls

2010-08-26 Thread Russell Keith-Magee
On Fri, Aug 27, 2010 at 2:12 AM, Carl Karsten wrote: > I would like to discus my patch to add support of nullable fields to > get_next_by_FOO > > http://code.djangoproject.com/ticket/13611 > >> You say "we" discussed this on IRC, but you don't say who "we" are. > > I forget who was involved in the

Re: Any interest in adding a navigation helper to Django?

2010-08-26 Thread Russell Keith-Magee
On Fri, Aug 27, 2010 at 12:25 AM, Yo-Yo Ma wrote: > I'm speaking about something like http://code.google.com/p/django-nav/ Whenever you're proposing to add something to the core, the big question you have to ask is "What do we gain by adding it to core?". The guideline for adding something to dj

Re: Proposal: Editable Model AutoField

2010-08-26 Thread Russell Keith-Magee
On Fri, Aug 27, 2010 at 2:28 AM, Joshua Russo wrote: > I've developed and I'm currently using a mod to allow auto-increment id > fields to be editable. I'm curious if I should produce a ticket to allow > this, or will it cause a problem on some DBMS I'm not aware of. The problem will come with da

Re: Feature request - set variables in template

2010-08-26 Thread Russell Keith-Magee
On Fri, Aug 27, 2010 at 8:06 AM, Yo-Yo Ma wrote: > I'm sure this will be met with criticism, but there is a reason why > just about all template languages allow the setting of variables. Yes. It's because most template languages are trying to be a Turing complete programming language. Django's te

Re: Feature request - set variables in template

2010-08-26 Thread David P. Novakovic
My 2c: The ability for a template editor (ie a frontend developer) to set variables in the global namespace opens up the potential for a designer to clobber variables delivered to the template from the view. The example you've provided is something that really falls to the responsibility of the vie

Re: Feature request - set variables in template

2010-08-26 Thread Yo-Yo Ma
You absolutely cannot. The "with" statement puts the variable in the scope of the "with" statement only, not to mention that would not be very explicit at all. On Aug 26, 6:14 pm, "David P. Novakovic" wrote: > You can basically do this with the "with" > statement:http://docs.djangoproject.com/en

Re: Feature request - set variables in template

2010-08-26 Thread David P. Novakovic
You can basically do this with the "with" statement: http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#with On Fri, Aug 27, 2010 at 10:06 AM, Yo-Yo Ma wrote: > I'm sure this will be met with criticism, but there is a reason why > just about all template languages allow the

Feature request - set variables in template

2010-08-26 Thread Yo-Yo Ma
I'm sure this will be met with criticism, but there is a reason why just about all template languages allow the setting of variables. It allows you to do things like: {% for thing in things %} {{ thing }} {% if thing.is_the_one %} {% set_var the_one thing%} {% endif %} {% endfo

Re: Unit test problem with the aggregation fixture

2010-08-26 Thread Joshua Russo
On Thu, Aug 26, 2010 at 9:11 PM, Karen Tracey wrote: > On Thu, Aug 26, 2010 at 6:05 PM, Joshua Russo wrote: > >> I'm trying to test a patch I'd like to submit but the fixture in the >> aggregation tests is failing on an integrity error. It looks like a problem >> with the order of the data, where

Re: Unit test problem with the aggregation fixture

2010-08-26 Thread Karen Tracey
On Thu, Aug 26, 2010 at 6:05 PM, Joshua Russo wrote: > I'm trying to test a patch I'd like to submit but the fixture in the > aggregation tests is failing on an integrity error. It looks like a problem > with the order of the data, where a child table is being loaded before a > parent. I fixed the

Unit test problem with the aggregation fixture

2010-08-26 Thread Joshua Russo
I'm trying to test a patch I'd like to submit but the fixture in the aggregation tests is failing on an integrity error. It looks like a problem with the order of the data, where a child table is being loaded before a parent. I fixed the order and then received the same type of error from the paren

Re: CSRF Middleware/SSL/Firefox 3.6.8 bug

2010-08-26 Thread Tim Chase
On 08/26/10 13:25, Jeff Balogh wrote: In our case the pref was accidentally disabled when testing add-ons, but people do intentionally turn off Referer for privacy reasons. I don't know if requiring Referer under https is a good idea. RFC-2616 makes it pretty clear that one should never requir

Proposal: Editable Model AutoField

2010-08-26 Thread Joshua Russo
I've developed and I'm currently using a mod to allow auto-increment id fields to be editable. I'm curious if I should produce a ticket to allow this, or will it cause a problem on some DBMS I'm not aware of. It's pretty simple really. 1) I check for the editable keyword in the constructor of the

Re: CSRF Middleware/SSL/Firefox 3.6.8 bug

2010-08-26 Thread Jeff Balogh
On Thu, Aug 26, 2010 at 10:23 AM, Mat Clayton wrote: > About to file this as a Bug in Trac but after some opinions first. > We are running django 1.2, and can't personally reproduce this bug, but some > of our users can do. We are using SSL and CSRF to protect our login pages, ( > https://www.mixc

get_next_by_FOO allows nulls

2010-08-26 Thread Carl Karsten
I would like to discus my patch to add support of nullable fields to get_next_by_FOO http://code.djangoproject.com/ticket/13611 > You say "we" discussed this on IRC, but you don't say who "we" are. I forget who was involved in the IRC discussion - the point was that it was a lengthy debate and a

CSRF Middleware/SSL/Firefox 3.6.8 bug

2010-08-26 Thread Mat Clayton
About to file this as a Bug in Trac but after some opinions first. We are running django 1.2, and can't personally reproduce this bug, but some of our users can do. We are using SSL and CSRF to protect our login pages, ( https://www.mixcloud.com/accounts/login/ ) in 99% of cases it works fine. How

Re: Any interest in adding a navigation helper to Django?

2010-08-26 Thread Yo-Yo Ma
You know what, I thought this hadn't been updated for 3 years because the downloads section isn't updated. I didn't bother to browse the SVN for change dates. Thanks Dougal. Rog On Aug 26, 10:32 am, Dougal Matthews wrote: > On 26 August 2010 17:25, Yo-Yo Ma wrote: > > > I'm speaking about somet

Re: Any interest in adding a navigation helper to Django?

2010-08-26 Thread Dougal Matthews
On 26 August 2010 17:25, Yo-Yo Ma wrote: > I'm speaking about something like http://code.google.com/p/django-nav/ > > One of the main issues I deal with when developing software with > Django is that I need to create a new template for every view that > changes navigation (e.g. tabs). The ability

Any interest in adding a navigation helper to Django?

2010-08-26 Thread Yo-Yo Ma
I'm speaking about something like http://code.google.com/p/django-nav/ One of the main issues I deal with when developing software with Django is that I need to create a new template for every view that changes navigation (e.g. tabs). The ability to generate some sort of a map that allows for sub-

Re: Why not remove csrfmiddlewaretoken in CsrfViewMiddleware from request.POST?

2010-08-26 Thread mucisland
On Aug 26, 3:03 am, Russell Keith-Magee wrote: > On Thu, Aug 26, 2010 at 12:55 AM, mucisland > wrote: > > I posted this also in Django users but got no response - maybe the > > question is too stupid or it was the wrong group... > > > Here's the deal: > > > I have various views which break on th

Re: django.contrib.views.login errors

2010-08-26 Thread Boguslaw Faja
'django-fathers' :-) On Wed, Aug 25, 2010 at 8:49 PM, Sergej dergatsjev eecho wrote: > I think, much less such emails will appear if this group will be renamed. > *contributors* for example... > > 2010/8/25 Karen Tracey >> >> Please ask questions about using Django on django-users, not here. The