raw_id_admin with non-integer primary key

2006-10-27 Thread atlithorn
This seems to be on the fritz again.Chgsets 785 and 790 for ticket #586 fixed this in pre-mr. I have a foreign key related table with a CharField primary key. Trying to add stuff in the admin creates a list of primary keys but save fails with "Enter only digits separated by commas." Any ideas? -

translation question

2006-05-11 Thread atlithorn
Can't seem to get my head around how to do the following: Need to output a translatable string like this: This is a link to stuff But I don't want to have the HTML tags in my string resources. and I don't want to split the string up into more than 2 elements ("This is a %(link) to stuff" and "li

Re: Multi level template inheritance

2006-04-11 Thread atlithorn
Found it. It's not altogether trivial so I thought I'd post it. In the middle template (index.html in my example) it is imperative to have the extnds tag on the very first line. I had a html comment line at the top which caused the parent connection to fail, an empty line has the same effect. This

Re: Multi level template inheritance

2006-04-11 Thread atlithorn
That's rather embarassing :) The example I wrote up was a short version of my template setup so I didn't bother testing and it obviously works as expected. Going to delve deeper into my templates then,sorry about jumping to conclusions. --~--~-~--~~~---~--~~ You r

Multi level template inheritance

2006-04-10 Thread atlithorn
Template inheritance question: Let's say I have the following templates, #1.base.html {%block start%}{%endblock%} {%block stuff%}hey hey{%endblock%} {%block stop%}{%endblock%} #2. index.html {%extends "base"%} {%block stuff%}ho ho{%endblock%} #3. different.html {%extends "index"%} {%block st

Re: Locale from URL Middleware

2006-04-05 Thread atlithorn
Glad I am not alone :) There is a little irritation in using the middleware posted above because I obviously have to account for the language in all lines in my urls.py (r'(\w\w/)?... and so on). I would prefer for this to have the same result as using an "include" statement, ie the prefix would b

Re: Locale from URL Middleware

2006-04-05 Thread atlithorn
I understand how django does it. Unfortunately I am forced to maintain a web structure that requires this functionality so that's why I wrote it. But I actually prefer this over the ambiguity in the browser settings which most people do not set anyway and the extra step required to select the righ

Locale from URL Middleware

2006-04-05 Thread atlithorn
Just in case anyone is interested... I wrote my own middleware class to support selecting languages from the URL itself. eg: www.example.com - default english www.example.com/de - same page with german trans It was a simple copy-paste of the LocaleMiddleWare from the distro: ##

Re: making photo gallery

2006-01-22 Thread atlithorn
Thanks for the filter, just thought I'd add to the equation, in case you need tables sorted down the column instead of across the row. def transtabularize(value,cols): try: cols = int(cols) except ValueError: return [value] r = len(value)/cols + (len(value)%cols>0)