Re: check_password in contrib auth tries to update the database

2014-06-01 Thread suhridsatyal
Hi Erik, Thanks for the explanation. This looks like something I could try. Another approach that I found recently was to use database routers[1]. This would not cause problems with password upgrades, but we would need to change some database permissions. [1] https://docs.djangoproject.com/en/d

Re: UpdateView, ModelForm - form not redirecting problem

2014-06-01 Thread Dan Gentry
What does it do instead? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to djan

Re: InlineFormSet validation

2014-06-01 Thread Russell Keith-Magee
Hi Cesar, It's all the documentation: https://docs.djangoproject.com/en/dev/topics/forms/formsets/#custom-formset-validation You just have to raise a ValidationError(); Django will then add an error that spans the entire formset. If you want to evaluate errors in clean(), but force the actual e

Re: django models

2014-06-01 Thread Tom Lockhart
On 2014-05-31, at 4:41 AM, ngangsia akumbo wrote: > please i need some legit answer please Please give one or two specific examples of functionality you need. There are parameters for fields which can help specialize some behaviours without needing a new model. And there are hooks to allow sp

InlineFormSet validation

2014-06-01 Thread César García Tapia
Hi. I already asked this question in StackOverflow, but I didn't get any useful answer. Let's try here :-) I have a BaseInlineFormSet, and I'd like to validate a field in the parent form based on the values on the fields of the children. As seen in the docs, the only method to make a custom val

Re: Transform list comprehension back to traditional looping construct, how?

2014-06-01 Thread Hannu Krosing
On 06/01/2014 03:00 PM, Pepsodent Cola wrote: > At first I was trying to use list.append but then Python complained > that append could only take 1 argument. So I google around and > list.extend said that it could take more arguments so I just went with it. > > What is this right method you are th

Re: Save django queries for reuse

2014-06-01 Thread Derek
You have not given enough details on your reporting setup; so my guess would be to save the details into a new table. This would include data such as: * id (for the record) * user_id * report_id * date_time * parameters The "parameters" are a text field; with the criteria/parameters which cr

Re: Transform list comprehension back to traditional looping construct, how?

2014-06-01 Thread François Schiettecatte
.extend() takes as a parameter something that can be iterated over and appends it to the list. Something that can be iterated over includes other lists, sets, tuples, dictionaries, see https://docs.python.org/2/tutorial/datastructures.html François On Jun 1, 2014, at 9:00 AM, Pepsodent Cola wr

Re: Transform list comprehension back to traditional looping construct, how?

2014-06-01 Thread Pepsodent Cola
At first I was trying to use list.append but then Python complained that append could only take 1 argument. So I google around and list.extend said that it could take more arguments so I just went with it. What is this right method you are thinking about? My imagination is very limited I only

Re: Transform list comprehension back to traditional looping construct, how?

2014-06-01 Thread Masklinn
On 2014-06-01, at 14:29 , Pepsodent Cola wrote: > Hi, I want to transform my articles_list5 list comprehension back to a > traditional looping construct to make things easier to read. > The articles_list5 returns a list of tuples. > > But when I try to do the same using traditional looping in

Transform list comprehension back to traditional looping construct, how?

2014-06-01 Thread Pepsodent Cola
Hi, I want to transform my *articles_list5* list comprehension back to a traditional looping construct to make things easier to read. The articles_list5 returns a list of tuples. But when I try to do the same using traditional looping in *articles_list6* then I just get one long list from everyt

Mocking Django queryset

2014-06-01 Thread Boris Ozegovic
Hi I am having trouble mocking querysets which contains slice. Example qs = Thread.objects.filter(some_filter).order_by(some_order')[:app_settings.SEARCH_LIMIT] And in my test I have: Thread.objects.assert_has_calls([ mock.call.filter('some_filter'), mock.call.filter()

Re: UnboundLocalError - How do I convert my pandas DataFrame into a list that Django can work with?

2014-06-01 Thread Pepsodent Cola
Never mind it seems using a tuple instead of a list solved my problem. subset = df[[0, 1, 2, 'FRACTION']] tuples = [tuple(x) for x in subset.values] On Saturday, May 31, 2014 8:15:16 PM UTC+2, Pepsodent Cola wrote: > > Exception Type: UnboundLocalError Exception Value: > > local va

Re: saving backbonejs model with django backend

2014-06-01 Thread Eddilbert Macharia
Hi, For anyone interested or stuck as i was this is what i did in my view and it started working,its not working optimamly as i wanted it to but its a working progress but its atleast saving to the database import json @csrf_exempt def saveFormDesign(request): data=request.body t=json.