Re: What hash algorithm does django auth use?

2009-03-31 Thread Matthew Somerville
Joshua Partogi wrote: > # Process the data in form.cleaned_data > user = User() > new_member = form.save(commit=False) > > new_member.password = user.set_password > ( new_member.password ) > instance = new_member.save() > > But it seems

Re: error in response['Content-Type']

2009-03-31 Thread Matthew Somerville
剑韬 付 wrote: > if response['Content-Type'].split(';')[0] not in safe_mime_types: > AttributeError: 'tuple' object has no attribute 'split' > here is the code snippets: > resp = HttpResponse(S3FileIter(block_hash_list, data_start, > content_length),\ > mimetype = >

Re: Like Statement in Raw SQL

2009-03-30 Thread Matthew Somerville
Francisco Rivas wrote: > sql = sql + 'AND f.url like "%%%s%%"' % (forge) > > cursor = connection.cursor() > cursor.execute(sql) > results = cursor.fetchall() cursor.execute() expects placeholders, rather than direct parameters, so needs % to be escaped on input - your one level of es

MySQL group_concat with aggregates

2009-03-29 Thread Matthew Somerville
Hi, I have the model described at http://docs.djangoproject.com/en/dev/topics/db/models/#intermediary-manytomany on which I have multiple rows in Membership with the same Person and Group (say they're a bit flaky, and leave and rejoin a few times ;) ). I wanted to print out a paginated list o

Re: Problem with Field errors

2009-03-29 Thread Matthew Somerville
Jack Orenstein wrote: > On Mar 29, 2009, at 9:35 AM, Matthew Somerville wrote: >> For more information, see >> http://docs.djangoproject.com/en/dev/ref/forms/validation/ > > Thanks, that's really useful to know about. This works for most of > the additional

Re: Problem with Field errors

2009-03-29 Thread Matthew Somerville
Jack Orenstein wrote: > On Mar 28, 2009, at 12:26 PM, Daniel Roseman wrote: > >> On Mar 28, 4:14 pm, Jack Orenstein wrote: >>> My application needs to validate data from a from beyond the >>> validation of Fields done by django. So in my form handler, I check >>> Form.is_valid, and if that retur

Re: django.contrib.auth.models.User User model can't be saved

2009-03-29 Thread Matthew Somerville
Joshua Partogi wrote: > Yes you're right. In my template I only have username, first_name, > last_name, email and password. I also print out the errors too. Nowhere are you printing out non-field specific errors - please read about non_field_errors at http://docs.djangoproject.com/en/dev/ref/fo

Re: django.contrib.auth.models.User User model can't be saved

2009-03-28 Thread Matthew Somerville
Joshua Partogi wrote: > That is exactly the problem. No exception is thrown. But I guess it > didn't pass the validation because it wasn't redirecting to another > page. Which is funny because all the required field in > django.contrib.auth.models.User object is filled in. How are you printing ou

Re: Contrib comments and removing fields for private comments

2009-03-27 Thread Matthew Somerville
coulix wrote: > however i feel like i am heading the wrong way, i saw that if a user > si logged in the email and user field of comment model will be > automatically assigned. Yes, they are. > Therefore maybe i just have to custom the form template instead of > customising the forms.py and model