Re: newforms - make possible to get "parts" of widgets by key/index, if they support __getitem__ protocol

2007-11-29 Thread Max Derkachev
A small correction. > > {{ form.choice.1 }} > [some markup with fields] > {{ form.choice.2 }} > etc... {{ form.choice.0 }} {{ form.choice.1 }} of course, 0-based indexes. Regards, Max --~--~-~--~~~---~--~~ You received this message because you are subscribe

newforms - make possible to get "parts" of widgets by key/index, if they support __getitem__ protocol

2007-11-29 Thread Max Derkachev
Hello. The problem which I faced today was that I should place several radio buttons for one ChoiceField in several places. E.g.: [radio name=choice value=1] [some markup with fields] [radio name=choice value=2] [some markup woth fields] Of course, I could hardcode the fields to the template, b

Re: Changing django.contrib.auth to make passwords optional

2007-05-11 Thread Max Derkachev
Sorry, I misunderstood. The last association is only deleted when the password is set. Got it. Regards, Max --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send ema

Re: Changing django.contrib.auth to make passwords optional

2007-05-11 Thread Max Derkachev
> The problem with using a random password is that you can't answer the > question "does this account have a password set?". I need to be able > to answer that question because my OpenID implementation allows users > to associate mupltiple OpenIDs with a single account. I want to let > them delete

Re: Context scope only block-wide?

2007-04-12 Thread Max Derkachev
> Hmm. Aren't objects with __del__ attributes rare in pure python, or > is there some other way you're thinking the gc couldn't collect the > cycle? Well, you don't know how are they rare indeed. Though, weakrefs are simple and safe. --~--~-~--~~~---~--~~ You re

Re: Context scope only block-wide?

2007-04-12 Thread Max Derkachev
One thing - if you alias the top context at the top level, You'll end up with memory leak - there will be a circular reference. It can be avoided, if the context variable would hold a weakref.ref to the top context. On Apr 12, 5:04 pm, "Max Derkachev" <[EMAIL PROTECTED]> w

Re: Context scope only block-wide?

2007-04-12 Thread Max Derkachev
Well, you can alias a top-level context in a context variable, and then set the variable in that aliased context. class AliasContextNode(template.Node): def __init__(self, varname): self.varname = varname def render(self, context): context[self.varname] = context.dicts[0]

Re: User.get_profile is too NIH-unfriendly

2007-04-04 Thread Max Derkachev
on profile class (the example in the code in the message below). On Apr 4, 5:21 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 4/4/07, Max Derkachev <[EMAIL PROTECTED]> wrote: > > > That's not a problem. The API lookup can be easily emulated in cu

Re: User.get_profile is too NIH-unfriendly

2007-04-04 Thread Max Derkachev
The code would be like So, the code would be something like def get_profile(self): """ Returns site-specific profile for this user. Raises SiteProfileNotAvailable if this site does not allow profiles. """ if not hasattr(self, '_profile_cache'):

Re: User.get_profile is too NIH-unfriendly

2007-04-04 Thread Max Derkachev
On Apr 4, 2:09 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 4/4/07, Max Derkachev <[EMAIL PROTECTED]> wrote: > > > Well, User do nothing with the profile other then simply loading it in > > get_profile. > > Except that 'get_profile'

Re: User.get_profile is too NIH-unfriendly

2007-04-04 Thread Max Derkachev
Hi James. > > Second, models.get_model(app_label, model_name) enforce that the > > profile object must be a Model subclass and should be in > > INSTALLED_APPS. > > I think this is worth living with -- the standard use case will be > that it's a Django model class, and if it's not it becomes a nig

User.get_profile is too NIH-unfriendly

2007-04-03 Thread Max Derkachev
Hi. The offending code is: 1. app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.') 2. model = models.get_model(app_label, model_name) First, it does not behave properly if the settings.AUTH_PROFILE_MODULE is something like 'path.to.app.models.Profile'. Second, models.get_model(app_lab

Re: newforms.util.ValidationError has nothing in common with core.validators.ValidationError. Why?

2007-03-22 Thread Max Derkachev
Hi Adrian, > Things are in flux with newforms right now, as they've been for a > while, so the only thing I can say is, please be patient. We're aware > of the fact that things are in flux, and, speaking as a perfectionist, > chances are that it bothers me even more than it bothers you. :) Thank

Re: newforms.util.ValidationError has nothing in common with core.validators.ValidationError. Why?

2007-03-20 Thread Max Derkachev
Hi, Adrian, > Use django.newforms if you want your code to be forwards-compatible. Sure. But why not to use the [one] validators set (or at least, one exception class) in the long term, both in models and forms? What to do with the validators that are used in models, including builtin? Model.va

newforms.util.ValidationError has nothing in common with core.validators.ValidationError. Why?

2007-03-20 Thread Max Derkachev
The ValidationError exception from newforms knows nothing of ValidationError from validators. That make useless any validators, builtin or custom, that was defined for model fields, if one wanted to use them in related form field validation. If the first at least extended the second, we could do s

UNICODE maybe?

2007-01-17 Thread Max Derkachev
Unicode haven't been mentioned in your list and haven't made to http://code.djangoproject.com/wiki/VersionOneFeatures http://groups-beta.google.com/group/django-developers/browse_frm/thread/1debd2337965a765 http://groups-beta.google.com/group/django-developers/browse_frm/thread/6268156

Re: BUG: template.NodeList and non-ascii data

2006-11-07 Thread Max Derkachev
Filled as #2996 Regards, Max --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send

BUG: template.NodeList and non-ascii data

2006-11-01 Thread Max Derkachev
code.djangoproject.com's Trac rejected my ticket as supposed spam, so I'll try to fill it here: template.Nodelist.render raised an exception in return ''.join(bits) UnicodeDecodeError : 'ascii' codec can't decode byte 0xd1 in position 3128: ordinal not in range(128) The problem was that the c

FormField.html2python is a static method. Why?

2006-10-22 Thread Max Derkachev
FormField and its subclasses should define html2python as a static method, and FormField.convert_post_data calls the method so that it must be static: self.__class__.html2python(data) So, it is impossible to access the field's instance attributes while converting data. I've just faced a need of f

bump: give Gabor (or somebody else) a unicode branch in svn

2006-10-13 Thread Max Derkachev
There were a lot of words about unicodification of Django, but things has not been moved a bit further. The beginning is at http://groups.google.com/group/django-developers/browse_frm/thread/bad8f2c4628646dc Regards, Max --~--~-~--~~~---~--~~ You received this

Re: Cross-process event dispatcher

2006-09-26 Thread Max Derkachev
Hi! The first problem I saw with Pyro Event Server is that it seems to me too complex for the task. Django uses PyDispatcher as the in-process event subsystem. In order to make the event objects network-dispatchable, the only thing that should be done is to find a way to serialize events somehow,

Re: Cross-process event dispatcher

2006-09-25 Thread Max Derkachev
Hi. I have the very first working prototype. Now it works over UDP, using asyncore library. UDP is unreliable under heavy load, so I don't recommend using it in production. However, my dispatch system abstracts event dispatching from the transport, so any suitable transport can be plugged in. It's

Re: Local unicode-related fixes

2006-09-19 Thread Max Derkachev
+1 Let the thing begin. Regards, Max. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this grou

Cross-process event dispatcher

2006-09-04 Thread Max Derkachev
Hello all. Since Django apps tend to function in multi-process environments (both in mod_python and FastCGI modes), I've faced a necessity to route events between processes that execute Django application instances. Django uses PyDispatcher to dispatch events, but it's a single-process and can not

Re: JavaScript and Changeset 3541

2006-08-18 Thread Max Derkachev
Hi Adrian, Thanks for explanation. I am also against bundling any JS toolkit with *core* framework. -- Regards, Max --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group

Re: JavaScript and Changeset 3541

2006-08-17 Thread Max Derkachev
There's no established use of Dojo with Django yet. Hopefully, there would be no such "established uses" with any JS library. Django is a server-side framework. Even id Django is our framework of choice, let us decide which client-side framework to use in our applications. Regards, Max. --~--~

Re: JavaScript and Changeset 3541

2006-08-17 Thread Max Derkachev
>I have not looked at this branch at all, but I'll strongly suggest > that you remove the YUI stuff. Adrian, could You explain your opinion a bit more? Does that mean that there are plans to bundle another toolkit? If yes, what toolkit? Regards, Max --~--~-~--~~~-