Re: Django admin - dinamically update through ajax choices of a ChoiceField in a ModelForm

2013-09-21 Thread C. Kirby
If you can, populate the widget with all available choices and then use your JS/AJAX to limit/hide some? On Saturday, September 21, 2013 6:32:03 PM UTC-5, luke lukes wrote: > > Hi everyone. > > I'm stucking with a ModelForm in the admin. I have two ChoicheField which > are populated with

Re: and keyword arguments '{u'student_id': None, u'school_id': 1}' not found.

2013-09-21 Thread Trung Nguyen
If I pass in a variable to the template like return render_to_response("grading_school_form.html", RequestContext(request, { "formset": formset, "pk":school_id, "spk":1})) then in the template {% for form in formset %} {{ spk }} {{ form.first_name }} {{

Re: Overriding Settings before running any tests that loads fixtures.

2013-09-21 Thread Mike Dewhirst
On 22/09/2013 9:47am, Alex Thomas wrote: My basic problem is that I am trying to run a test that loads fixtures but I want to modify some settings before the fixtures are loaded. Check out Two Scoops of Django - there is a whole chapter on this. Esssntially you need some test settings which

Re: I can run django-admin.py, but not manage.py.

2013-09-21 Thread Oscar Carballal
The manage.py is not executable by default, you should be running it with: $ python manage.py or if you want it to be executable forever and run it with ./manage.py do: $ chmod +x manage.py 2013/9/22 Jimmy Pants > Noob here. I installed Django, and as the title says, I

I can run django-admin.py, but not manage.py.

2013-09-21 Thread Jimmy Pants
Noob here. I installed Django, and as the title says, I can run django-admin without a problem, but manage.py gives: $ manage.py manage.py: command not found $ ./manage.py bash: ./manage.py: Permission denied $ sudo ./manage.py [sudo] password for me: sudo: ./manage.py: command not found

Overriding Settings before running any tests that loads fixtures.

2013-09-21 Thread Alex Thomas
My basic problem is that I am trying to run a test that loads fixtures but I want to modify some settings before the fixtures are loaded. I tried adding override_settings decorator on the class but it does not see to take effect before the fixtures are loaded. I also posted the question

Django admin - dinamically update through ajax choices of a ChoiceField in a ModelForm

2013-09-21 Thread luke lukes
Hi everyone. I'm stucking with a ModelForm in the admin. I have two ChoicheField which are populated with choices in __init__: self.fields['city'] = forms.ChoiceField( required=False, ) self.fields['city'].choices=get_cities_tuple(region_code=region_code) self.fields['city'].initial =

Re: Help with Django installation on windows

2013-09-21 Thread Chris Kavanagh
Hi Poom. . .You need to make sure that Django AND Python are on your system path. I'll run you through how to do that. . .Right click on "My Computer", choose "Properties", on the "Properties Window" choose the "Advanced Tab", then choose "Environment Variable". In that window it'll be divided

Re: Help with Django installation on windows

2013-09-21 Thread Poom Buncha
> > I see, thank you for your quick reply I will try Virtualenv and pip > -- 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

Re: and keyword arguments '{u'student_id': None, u'school_id': 1}' not found.

2013-09-21 Thread Trung Nguyen
On Friday, September 20, 2013 10:44:33 PM UTC-5, Trung Nguyen wrote: > > Django Version:1.5.2Exception Type:NoReverseMatchException Value: > > Reverse for 'gradingstudent' with arguments '()' and keyword arguments > '{u'student_id': None, u'school_id': 1}' not found. > > Exception >

Re: and keyword arguments '{u'student_id': None, u'school_id': 1}' not found.

2013-09-21 Thread Trung Nguyen
I found it. Inside {%%} shoud use variable. Inthis case is form.instance.id instead of {{form.instance.id}} On Saturday, September 21, 2013 5:06:07 PM UTC-5, Trung Nguyen wrote: > > No this not add form and I verify it. I also use pk but it does not work > either. > > On Saturday, September

Re: Help with Django installation on windows

2013-09-21 Thread Avraham Serour
you should use pip to install python packages, after you have pip you can use "pip install django" eventually it is worth to take a look at virtualenv so you can have separate environments and packages for each project in any case you should use "python

Re: Help with Django installation on windows

2013-09-21 Thread Tom Lockhart
On 2013-09-21, at 1:27 PM, Poom Buncha wrote: > Hi all > > First off, I like to say that I am a beginner to everything related to > computing. So I have to appologize a head of time if what I am asking is > common sense. > I'm trying to install Django on my windows

Re: and keyword arguments '{u'student_id': None, u'school_id': 1}' not found.

2013-09-21 Thread Trung Nguyen
No this not add form and I verify it. I also use pk but it does not work either. On Saturday, September 21, 2013 7:38:52 AM UTC-5, Daniel Roseman wrote: > > On Saturday, 21 September 2013 04:44:33 UTC+1, Trung Nguyen wrote: > >> Django Version:1.5.2Exception Type:NoReverseMatchException Value:

Help with Django installation on windows

2013-09-21 Thread Poom Buncha
Hi all First off, I like to say that I am a beginner to everything related to computing. So I have to appologize a head of time if what I am asking is common sense. I'm trying to install Django on my windows computer So I install Python 2.7 (and went throught the tutorial) I downloaded the

Re: and keyword arguments '{u'student_id': None, u'school_id': 1}' not found.

2013-09-21 Thread arjun
And you shouldn't be using id's. using pk is better! On Saturday, September 21, 2013 9:14:33 AM UTC+5:30, Trung Nguyen wrote: > > Django Version:1.5.2Exception Type:NoReverseMatchException Value: > > Reverse for 'gradingstudent' with arguments '()' and keyword arguments > '{u'student_id': None,

Re: and keyword arguments '{u'student_id': None, u'school_id': 1}' not found.

2013-09-21 Thread Daniel Roseman
On Saturday, 21 September 2013 04:44:33 UTC+1, Trung Nguyen wrote: > Django Version:1.5.2Exception Type:NoReverseMatchException Value: > > Reverse for 'gradingstudent' with arguments '()' and keyword arguments > '{u'student_id': None, u'school_id': 1}' not found. > > Exception >

Re: Testing in Django - newbie questions on first test failure and coverage

2013-09-21 Thread Derek
Rafael I appreciate your reply; below I try and explain further the reasoning behind the approach I took. If you can respond to that, it would help. Firstly, the issue of test file locations - there are least two places I have found that recommend these be placed in a different directory:

Re: iterating over a queryset?

2013-09-21 Thread Johan Bergkvist
Daniel Roseman adviced me to use the Shell. This was a fantastic idea, and one I should have thought of myself! Anyway this helped me realize that I was referencing related models the wrong way. For some reason I thought that you should reference the model name and not the foreign key field