Re: {{ something or something_else }}

2008-04-25 Thread Wolfram Kriesing
foo bar baz > evaluate to False. > > On Apr 25, 6:35 pm, "Wolfram Kriesing" <[EMAIL PROTECTED]> > wrote: > > > thank you for all the quick replies. > > Mmmmh, its good to see that it is there, though I think > > {{ num_files or "no

Re: {{ something or something_else }}

2008-04-25 Thread Wolfram Kriesing
Honza Král <[EMAIL PROTECTED]> wrote: > there is a template filter called default, that does exactly this. > > http://www.djangoproject.com/documentation/templates/#default > > On Fri, Apr 25, 2008 at 4:15 PM, Wolfram Kriesing > > <[EMAIL PROTECTED]> wrote: >

{{ something or something_else }}

2008-04-25 Thread Wolfram Kriesing
I guess it might had been discussed, just didnt find anything. This extended syntax would really make some writing shorter user has {{ num_files or "no" }} files now, you have to write user has {% if num_files %} {{ num_files }} {% else %} no {% endif %} files Are there an

Re: i18n missing feature ... continued (proposed solution for the upcoming sprint)

2008-01-18 Thread Wolfram Kriesing
hi guys, is there some kind of follow up to this topic or is it simply dead? wolfram On Nov 26, 2007 11:58 AM, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > I would like to allow the following too: > > {% blocktrans %} >Received on {{ message.created|date as date }} >

Re: DB API - the limiting syntax, is it magic?

2007-12-04 Thread Wolfram Kriesing
you are right! lol, trapped myself nicely ... happens when you dont think :-) thx wolfram On Dec 4, 2007 3:57 PM, Luke Plant <[EMAIL PROTECTED]> wrote: > > On Tuesday 04 December 2007 14:41:07 Wolfram Kriesing wrote: > > another thing i jsut ran into: > > >

Re: DB API - the limiting syntax, is it magic?

2007-12-04 Thread Wolfram Kriesing
wolfram On Dec 4, 2007 9:53 AM, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > I remember my beginner times with django, i was searching for limit() > until I had to remind myself multiple times that you have to use [x:y] for it. > limit() seemed the reasonable straightforward thin

Re: DB API - the limiting syntax, is it magic?

2007-12-04 Thread Wolfram Kriesing
On Dec 4, 2007 10:00 AM, Michael Radziej <[EMAIL PROTECTED]> wrote: > > On Tue, Dec 04, Gary Wilson wrote: > > > And I say QuerySets are more like lazy-evaluated lists. lists are iterable > > and can be sliced. > > I think this hits the point. > > What do you think about this: a QuerySet fetches

Re: DB API - the limiting syntax, is it magic?

2007-12-04 Thread Wolfram Kriesing
I remember my beginner times with django, i was searching for limit() until I had to remind myself multiple times that you have to use [x:y] for it. limit() seemed the reasonable straightforward thing ... and thats what i am used to from python but this time it was different Providing limit() wou

Re: i18n missing feature ... continued (proposed solution for the upcoming sprint)

2007-11-26 Thread Wolfram Kriesing
I would like to allow the following too: {% blocktrans %} Received on {{ message.created|date as date }} ... this removes the "with-as" stuff from the blocktrans completely to increase the readablitiy of the entire block and not squeeze all the variables in at the opening blocktrans wolfram

Re: i18n missing feature ... continued (proposed solution for the upcoming sprint)

2007-11-26 Thread Wolfram Kriesing
+1 Wolfram On Nov 26, 2007 9:22 AM, alain D. <[EMAIL PROTECTED]> wrote: > > Hi, > > Trying to sum up the discussions so far I would say that Wolfram's > syntax seems to be the preferred one : i.e. letting the logic go into > the translated string but keeping the strings to translate in one bit

Re: i18n missing feature ... continued (proposed solution for the upcoming sprint)

2007-11-20 Thread Wolfram Kriesing
> - regarding the problem that the translation is maintained in > chucks : if not then there is the presence of logic in the translation > string, which is not possible I think. If you agree on that, it means > that the translation _has_ to be maintained in chucks This nails the main problem im

Re: i18n missing feature ... continued (proposed solution for the upcoming sprint)

2007-11-19 Thread Wolfram Kriesing
Hi, I was following this thread, since I also think a solution is needed here, badly! I think Alain's initial solution is the best until now, and closest to what is needed, but true, its tooo complex. I don't have a final solution but may be one step ahead ... I know the big problem here is to m

Re: repr for lazy translation

2007-09-26 Thread Wolfram Kriesing
On 9/26/07, Andrew Durdin <[EMAIL PROTECTED]> wrote: > > On 9/26/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > > > > I ran into the problem while doing this: > > > > >>> from django.utils.translation import gettext_lazy as _ > >

Re: repr for lazy translation

2007-09-26 Thread Wolfram Kriesing
I ran into the problem while doing this: >>> from django.utils.translation import gettext_lazy as _ >>> s = _("my string") >>> s += _("my second string") Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for +=: '__proxy__' and '__proxy__' >>> the

Re: django translation feature missing (?)

2007-06-14 Thread Wolfram Kriesing
it gets even more difficult in languages like russian, where i think that a name depends on the linguistic case of the sentence it is used in ... wolfram On 6/14/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > yeah that is not really a nice way to do it, but the only possible one &g

Re: django translation feature missing (?)

2007-06-14 Thread Wolfram Kriesing
yeah that is not really a nice way to do it, but the only possible one currently. We were discussing this issue a lot here, and have not come up with a final nice syntax yet either, since there are a couple issues that come up, but they just come up when you run into them :-) On 6/14/07, Malcolm

Re: django translation feature missing (?)

2007-06-14 Thread Wolfram Kriesing
but watch out, gettext doesnt like line breaks inside a blocktrans, i only added them for readbility On 6/14/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > I understand Alans problem very well, the problem is that the text > "this has been done by user A-HREF" >

Re: django translation feature missing (?)

2007-06-14 Thread Wolfram Kriesing
I understand Alans problem very well, the problem is that the text "this has been done by user A-HREF" is not always translated in the same order of words for all the languages, so the "XXX" which is a link (in alains example) might be at some other position, like in german "Dies wurde von

Re: Django is really starting to muddle MVC, and it has me concerned

2007-04-13 Thread Wolfram Kriesing
On 4/12/07, jp <[EMAIL PROTECTED]> wrote: > > Oh, in addition I was wondering what the 'right' way to do this would > be at the current time? very nice that you are bringing this up. I am also just waiting for the wholy grale on this one. Since I have tried creating forms from models, fields and

Re: Context scope only block-wide?

2007-04-11 Thread Wolfram Kriesing
or something alike. regards Wolfram On 4/11/07, Gulopine <[EMAIL PROTECTED]> wrote: > > On Apr 11, 8:10 am, "Wolfram Kriesing" <[EMAIL PROTECTED]> > wrote: > > The "add_data" adds the data to the context inside the render() > > function of the t

Context scope only block-wide?

2007-04-11 Thread Wolfram Kriesing
I have written a new tag "add_data", which (if i break it down) does only store some data, that it gets passed or generates (in the example below it gets the data from the template, for easier demonstration) {% add_data "one" %} {% for u in users %} {% add_data "two" %} {% endfor %} {% add_

Re: json serialization problems solved

2007-04-04 Thread Wolfram Kriesing
darn, it must have slipped into the spam, sorry. thx for the reply On 4/4/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 4/4/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > > > > I have summarized the problems I had with django's

json serialization problems solved

2007-04-04 Thread Wolfram Kriesing
I have summarized the problems I had with django's json serializer here http://wolfram.kriesing.de/blog/index.php/2007/json-serialization-for-django i would be very interested if I might be doing something completely wrong or if those are reall life problems other people have too. If so I would b

Re: field paramter for select_related(depth=N, fields=[])

2007-04-02 Thread Wolfram Kriesing
On 4/2/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > On 4/2/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > > 1) How can I help getting this functionality into trunk? (enhance the > > patch, write doc, ...) > > 2) Is this something that would be

field paramter for select_related(depth=N, fields=[])

2007-04-02 Thread Wolfram Kriesing
There is an existing ticket (http://code.djangoproject.com/ticket/3275), which had been partially implemented (http://code.djangoproject.com/ticket/3275#comment:10). This commit adds the depth parameter, nice thing. Thanks! The second parameter "fields" has not been added yet. It can help reduce

Re: Switching the db_table on the fly

2007-03-26 Thread Wolfram Kriesing
On 3/26/07, Jeremy Bowers <[EMAIL PROTECTED]> wrote: > > Wolfram Kriesing wrote: > > The main reason I need this is that I want to have a transparent model > > that switches the underlying language (the according DB table it > > should work on) on the fly, so i

Re: Switching the db_table on the fly

2007-03-26 Thread Wolfram Kriesing
On 3/26/07, Honza Král <[EMAIL PROTECTED]> wrote: > On 3/26/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > > > > I would like to change the table of a model on the fly. > > I was looking into the Manager code, but since the get_query_set() > > method in t

Switching the db_table on the fly

2007-03-26 Thread Wolfram Kriesing
I would like to change the table of a model on the fly. I was looking into the Manager code, but since the get_query_set() method in there uses the model as is, changing the model._meta.db_table would most probably change the db_table for all users/threads, not only for the current one, right? An

Ticket+Patch+doc exists, whats next?

2007-01-19 Thread Wolfram Kriesing
http://code.djangoproject.com/ticket/3163 what do i need to do next to get this in or rejected? -- thx Wolfram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send

alternative JSON encoder

2007-01-12 Thread Wolfram Kriesing
I had the following problems with the default json encoder that is suggested to use: * cant handle Decimal * ignores properties that are not fields, it only encodes the fields (but i often add more properties to the object for passing to the template) * has problems with some m2m relations (at lea

Whitelist me please in trac

2006-10-31 Thread Wolfram Kriesing
Could someone please add   [EMAIL PROTECTED]to the whitelist, so i can add tickets to trac.thx-- cu Wolfram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, se