Logger parameters not accepted in AdminMailHandler?

2011-10-16 Thread momo2k
Hello, strange Problem here: LOGGER = logging.getLogger('somename') LOGGER.error('Could not do something: %s', err.output, exc_info=True) In the mail it shows 'Could not do something: %s', but in the logfile (RotatingFileHandler) %s is correcly substituted by err.output. Am I missing the

Re: "Dynamic" Typing for Models?

2011-10-03 Thread momo2k
A minute ago I have understood what proxy inheritance is good for. sorry! On 4 Okt., 01:26, momo2k <tkew...@googlemail.com> wrote: > Hello, > > this may be a python-general question, but it came across my way while > working with django: > Imagine you have a model: > >

"Dynamic" Typing for Models?

2011-10-03 Thread momo2k
Hello, this may be a python-general question, but it came across my way while working with django: Imagine you have a model: class A(Model) name = CharField() type = SmallIntegerField(choices=SOME_TYPES) def do_something(self): fancy_things I want do_something() do

Re: form.is_valid() NOT triggering model validation?

2011-09-29 Thread momo2k
Well, with the new knowledge about the debugger I found the place where BaseModelForm calls all three form-validation methods in forms/ models.py:306:_post_form Sorry. On Sep 29, 9:26 pm, momo2k <tkew...@googlemail.com> wrote: > That explains my thoughts that the debugger is &q

Re: form.is_valid() NOT triggering model validation?

2011-09-29 Thread momo2k
That explains my thoughts that the debugger is "disturbing" the correct execution of the code, but this discussion does *not* (!) answer my question where the *model* of a *ModelForm* gets full_clean- ed - and why it doesn't do so in my case. On Sep 29, 8:48 pm, Shawn Milochik

form.is_valid() NOT triggering model validation?

2011-09-29 Thread momo2k
Hello, after hours of examinating and debugging the Django source code I decided to post my problem here. I'm using Django 1.3.1 and its docs say: The is_valid() method and errors Changed in Django 1.2: Please, see the release notes The first time you call is_valid() or access the errors

Re: ModelAdmin, custom field: default value?

2011-06-28 Thread momo2k
Thanks, working :) def __init__(self, *args, **kwargs): super(MealModelForm, self).__init__(*args, **kwargs) try: instance = kwargs['instance'] self.fields['price'].initial = instance.price() except (KeyError, AttributeError): pass

ModelAdmin, custom field: default value?

2011-06-27 Thread momo2k
Hello, Is there a way to set dynamic default values for custom fields in the admin? Description of the problem: # models.py # there are two models class Meal(models.Model): name = ... def check_new_price(self, price): # checks if the price is new and creates a new price if

Re: __unicode__() addition not working in basic poll application.

2011-05-16 Thread momo2k
Did you restart the interpreter after adding the code? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to

Re: Makemessages Multiline

2011-05-08 Thread momo2k
Well, dos2unix solved -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more

Re: Makemessages Multiline

2011-05-06 Thread momo2k
No one? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this

Makemessages Multiline

2011-05-02 Thread momo2k
I'm using Django for about a year by now and I'm using translation since users of my website are mixed german/english speaking. makemessages works well on Windows, but on Debian 5 it doesn't work with multiple line messages and I can't figure out why. I'm sure it's a simple problem, but I don't