Re: how to use email instead of username for user authentication?

2009-04-01 Thread johan . uhle
Best way is to write your own authentication backend I think. Check the docs: http://docs.djangoproject.com/en/dev/topics/auth/?from=olddocs#writing-an-authentication-backend This article might also give you a good idea:

Re: Forms: custom clean for DateField

2009-03-19 Thread johan . uhle
> if (data['firstDate'] >= data['lastDate']): > raise ValidationError("Error") it should read raise forms.ValidationError If you want to have the error not only as a non_field global error, but actually added to the fields where the error occured, you can do the following in

Re: How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread johan . uhle
> How does Django enable the ability to pass variables to a Form or a > Template whose purpose is only to be displayed? Given that the input has been validated correctly and does not throw an error you can access the value with form.cleaned_data.username If you want to pass a variable to a

Re: Missing something obvious in auto-form generation

2009-03-13 Thread johan . uhle
You were missing to give the definition of Foo. I assume, that you are using ModelForm http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ to create FooForm, right? > model = Foo() > form = FooForm(instance=model) If you did so, you can just skip the instance and replace this

Re: Advice on project structure

2009-03-11 Thread johan . uhle
in terms of the "django poster-child" site http://www.satchmoproject.com/ might be a good start and you may also want to have a look at http://pinaxproject.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Strange behaviour with templates, dictionarys, key/value, tuple as key and nested for loop Bug?

2009-03-11 Thread johan . uhle
Of course you are right. I already changed that in my real code. This one here was just for having as simple code as possible in the mailing list post. This reminds me of this tweet: http://twitter.com/pht/status/1302494813 I always try to keep an eye on naming stuff, even if it means thinking

Re: Strange behaviour with templates, dictionarys, key/value, tuple as key and nested for loop Bug?

2009-03-11 Thread johan . uhle
Thanks a lot. I was just blind eyed yesterday I think. Corrected code is: {% for key,value in dictionary.items %} {{key|date:"Y-m-d"}} {% for key,value in value.items %} {{ key.0|date:"H.i" }} - {{ key.1|date:"H.i" }} {{ value }} //