Re: ForeignKey with null=True

2010-12-16 Thread tonnzor
My idea was to fix this in a very straight way - change ForeignKey behavior (the piece of code that generates many_set method) - so it doesn't take into account null. Let me explain a bit more. If foreign key is null - then there's no link between Many and One object. So it many_set should return

Translate permissions names on its generation

2010-11-26 Thread tonnzor
Dear Django developers! Please, look at the table auth_persissions - it has following structure (and data - trimmed): Here's a small piece of data: {{{ +-+--- +-++ | id | name

Re: Another urlpatterns proposal (add method column)

2007-10-03 Thread tonnzor
As far as I see, reversing url is getting URL for a view. Then, if view has only one route, there's no need to provide HTTP method. But if there are > 0 routes to the same view, we can add optional METHOD option. Examples: {# typical usage: #} Goods {# exclusive usage, many routes t

Another urlpatterns proposal (add method column)

2007-10-02 Thread tonnzor
IMHO, we should move typical logic of switching actual view according to request HTTP method from views to urls.py. Dispatching URLs using info from request is a job for urls.py, not for views itself. I think following code is inefficient and does the same as urls.py does with URL of requests: #

Re: Templates: short comments {##} eats text

2007-04-27 Thread tonnzor
OK. If the decision is made (forbid newlines in comments), then newlines should be _really_ forbidden (currently not). Opened a ticket for it - http://code.djangoproject.com/ticket/4171 On 27 апр, 00:46, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 4/26/07, tonnzor <[E

Re: Templates: short comments {##} eats text

2007-04-26 Thread tonnzor
> We already have multiline comments. They are written as {% comment %} > and {% endcomment %}. This inconveniently to use. Short variant {##} is much better and very similar to C /* */. > > So why can't we enable newlines for {##} only? > > This tag is parsed just as normal tags, so introducing

Re: Templates: short comments {##} eats text

2007-04-26 Thread tonnzor
> > 2. If we want to enable multi-line comments, we need to allow newlines > > in tag's content: > > We don't want to allow newlines in tags. That decision has already been > made and reaffirmed a number of times. Comments are not actually a tag, it's a special case. And it is very useful to have

Re: Templates: short comments {##} eats text

2007-04-23 Thread tonnzor
I reviewed templates engine and found the problem. Here are the patches: 1. template.Lexer incorrectly recognizes ALL tokens - it check only the beginning of the token, ignoring the end of it. Example: {{ my_var }} {{ other_var ## : variable other_var will be printed Current code (template/__i

Templates: short comments {##} eats text

2007-04-06 Thread tonnzor
Short templates comments {# #} are odd if used incorrectly - it eats text. This template (invalid comments): Hello {# this comment has newlines #} World! {{ "some more text" }} Now produce this output (text "World!" is eaten): Hello some more text Yes, the comments are invalid, but in this ca

Templates: short comments {##} should allow multi-line comments

2007-04-06 Thread tonnzor
I think that short template comments should allow multi-line comments - it is much easier to use {# #} instead of {% comment %} {% endcomment %} Now short comments do not allow newlines in them, so following template is invalid: {# very long many-lines comment #} It seems odd that this code do