Re: template for "Pagination for admin inlines" snippet

2013-02-06 Thread Axel Rau
Am 05.02.2013 um 22:16 schrieb Conor Pollock: > I'm currently trying to figure this out as well... I can pass a page query > in the url and everything works as expected, but I can't figure out how to > render the pagination controls in my template file. > > Did you ever get this to work? No,

Re: plz help me for error in python for django.....

2013-02-06 Thread Sergiy Khohlov
1) please provide your model Poll 2) are you run syncdb ? Many thanks, Serge +380 636150445 skype: skhohlov 2013/2/6 Avnesh Shakya : > > Here i want to explore database API but it's generating error.. > C:\mysite>python manage.py shell > Python 2.7.3 (default, Apr 10 2012, 23:31:26) [M

Re: plz help me for error in python for django.....

2013-02-06 Thread Avnesh Shakya
thanks. i m adding my polls file... On Wed, Feb 6, 2013 at 2:20 PM, Sergiy Khohlov wrote: > 1) please provide your model Poll > 2) are you run syncdb ? > Many thanks, > > Serge > > > +380 636150445 > skype: skhohlov > > > 2013/2/6 Avnesh Shakya : > > > > Here i want to explore database API b

Re: plz help me for error in python for django.....

2013-02-06 Thread Avnesh Shakya
thanks.. i have added my polls.models file On Wed, Feb 6, 2013 at 2:20 PM, Sergiy Khohlov wrote: > 1) please provide your model Poll > 2) are you run syncdb ? > Many thanks, > > Serge > > > +380 636150445 > skype: skhohlov > > > 2013/2/6 Avnesh Shakya : > > > > Here i want to explore database AP

Re: plz help me for error in python for django.....

2013-02-06 Thread Jani Tiainen
Now look your Poll model and try to find field "pub_date" there... :) 6.2.2013 11:03, Avnesh Shakya kirjoitti: thanks.. i have added my polls.models file On Wed, Feb 6, 2013 at 2:20 PM, Sergiy Khohlov mailto:skhoh...@gmail.com>> wrote: 1) please provide your model Poll 2) are you run

Interesting error with django.simple.test.DjangoTestSuiteRunner

2013-02-06 Thread chris
Hi everyone, We've been having this miscellaneous error with the default test runner in Django. We had a forms.py that was something like this: class SomeForm(forms.ModelForm): some_field = some_custom_fields.SomeCustomField(choices=get_some_queryset_and_evaluate_it()) # Actually, we're

Re: plz help me for error in python for django.....

2013-02-06 Thread Avnesh Shakya
thanks alot... but i have set it but again it's showing new error.. like... C:\mysite>python manage.py shell Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> fr

Re: get_initial on a ForeignKey on ModelForm not working properly

2013-02-06 Thread Michele Mattioni
Hi Timster, thanks for pointing to the right method. Now it works like a charm. Cheers, Michele On Mon, Feb 4, 2013 at 3:56 PM, Timster wrote: > By setting "initial" on a field, you are not changing the list of > available options. Setting the initial like this determines which of all > the l

Re: plz help me for error in python for django.....

2013-02-06 Thread Jani Tiainen
Django doesn't touch tables that already exists in database. So if you had model Poll run syncdb and then change, add or remove fields Django doesn't modify underlying table. There is few options that resolves your problem: - Manually migrate your database using plain SQL. - Recreate table or

admin - see detail inline

2013-02-06 Thread grat
Hi, i have this code: #Model class Client(models.Model): name= models.CharField(max_length=25) ... class Docs(models.Model): name= models.CharField(max_length=25) ... client = models.ForeignKey(Client) #Admin class Detail_Doc(admin.StackedInline): model = Docs class De

Re: Django ForeignKey versus ManyToManyField

2013-02-06 Thread Adam Mesha
On Wed, Feb 6, 2013 at 8:48 AM, Daniel Roseman wrote: > On Tuesday, 5 February 2013 22:39:30 UTC-8, vijay shanker wrote: > >> Hi >> I have two models, a Customer model and a WishListItem model (which >> stores products). I have option of either having a ManyToManyField in >> Customer to WishListIt

plz help me i have checked many time but i could not find error place.....

2013-02-06 Thread Avnesh Shakya
I have checked many time, even i have deleted my project n i have created new project again and create new model but error is occurred again n again.. i m beginner so plz help me C:\mysite>python manage.py shell Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on w

Re: plz help me i have checked many time but i could not find error place.....

2013-02-06 Thread Thomas Weholt
Have you executed python manage.py syncdb? Thomas On Wed, Feb 6, 2013 at 2:22 PM, Avnesh Shakya wrote: > > I have checked many time, even i have deleted my project n i have created > new project again and create new model but error is occurred again n again.. > i m beginner so plz help me >

Problen with Custom command and Bash Script

2013-02-06 Thread Jesús Lucas Flores
Hey guys, I need a little bit help with a custom manage.py command called *test* I am using it in a virtualenv on a shell script *script.sh*, The script.sh works well out of the cron and Wihiout activate the virtualenv also works well. but if the script is on the crontab give a *Unknown com

Re: plz help me i have checked many time but i could not find error place.....

2013-02-06 Thread Avnesh Shakya
ya i have executed python manage.py syncdb...but still it's giving error... On Wed, Feb 6, 2013 at 7:01 PM, Thomas Weholt wrote: > Have you executed python manage.py syncdb? > > Thomas > > On Wed, Feb 6, 2013 at 2:22 PM, Avnesh Shakya > wrote: > > > > I have checked many time, even i hav

Re: admin - see detail inline

2013-02-06 Thread Victor Rocha
I see more than one problem with your code. StackedInline is only used for models that have a one to many relationship and not the otherway around, in other words, you can have Docs stacked in line on the Client page but not the other way around, because only ONE client owns the document. You wi

Local Flavor - PhoneNumberField (KeyError: Invalid)

2013-02-06 Thread Derrick Jackson
Hi all, I am working on implementing the US PhoneNumberField and currently as long as I pass in the expected phone number length (10 digits) the number is formatting numbers just as I expect. However, if I dont put enough numbers in the form field, I get a Key Error. I can't for the life of

Re: plz help me i have checked many time but i could not find error place.....

2013-02-06 Thread Jaimin Patel
Do you see polls_poll table in your database? How does your db settings looks? On Wednesday, February 6, 2013 9:02:53 AM UTC-5, Avnesh Shakya wrote: > > ya i have executed python manage.py syncdb...but still it's giving > error... > > On Wed, Feb 6, 2013 at 7:01 PM, Thomas Weholt > > >

Re: plz help me i have checked many time but i could not find error place.....

2013-02-06 Thread Black9design.com
Depending on your project structure You may want to try adding the project name before polls_poll such as. Project_name_polls_poll. I hope that helps. Parker On Feb 6, 2013, at 5:22 AM, Avnesh Shakya wrote: > > I have checked many time, even i have deleted my project n i have created new >

Re: Object level permissions implementation

2013-02-06 Thread bobhaugen
I'm not sure this is the best way to do it, but for what I think is a similar situation, I created a template tag and a model instance method. The template tag asks the model instance method whether the user has permission. Here's the template tag: https://github.com/bhaugen/localecon/blob/mast

Re: plz help me i have checked many time but i could not find error place.....

2013-02-06 Thread Yussi
Does manage.py dbshell shows the tables? are you sure syncdb worked? what output did it give? settings.py have the database configured properly? sorry, I'm a django newb too. On 06/02/13 15:42, Black9design.com wrote: Depending on your project structure You may want to try adding the project na

Re: Problen with Custom command and Bash Script

2013-02-06 Thread Branko Majic
On Wed, 6 Feb 2013 05:39:55 -0800 (PST) Jesús Lucas Flores wrote: > Hey guys, > > I need a little bit help with a custom manage.py command called *test* > > > I am using it in a virtualenv on a shell script *script.sh*, > > The script.sh works well out of the cron and Wihiout activate the

Re: Problen with Custom command and Bash Script

2013-02-06 Thread Ali
I think this has to do with not mentioning the proper settings file. manage.py goes to the settings and checks all the installed apps for any custom commands, but if you haven't set proper settings file then it would not recognize those commands. You can either set the environment variable to D

No module named models again

2013-02-06 Thread frocco
Hello, What is the best way to track down these types of errors? in ntw.urls I have: (r'^checkout/', include('checkout.urls')), in checkout I have: urlpatterns = patterns('checkout.views', #(r'^$', 'show_checkout', {'template_name': 'checkout/checkout.html' }, 'checkout'), (r'^receipt/$

Maintenance on djangoproject.com tomorrow

2013-02-06 Thread Aymeric Augustin
Hi folks, We've scheduled maintenance operations on djangoproject.com tomorrow, starting at 09:00 UTC. The website and the docs may be temporarily unavailable. Please use the mirror of the docs at Read The Docs in the meantime: http://django.readthedocs.org/ Thanks, -- Aymeric. -- You r

Re: No module named models again

2013-02-06 Thread Brad
On Wed, 2013-02-06 at 10:31 -0800, frocco wrote: > Exception Location:C:\ndsutil\Menus\CTD-NDSUser\PycharmProjects\ntw > \checkout\views.py in , line 5 Django gives you the line in the file where the error occurs so you don't need to track it down ;-) It's probably failing when you try to import s

Re: No module named models again

2013-02-06 Thread frocco
Line 22 does not make any sense to me as to why it is failing. If I remove receipt, it runs fine On Wednesday, February 6, 2013 1:31:59 PM UTC-5, frocco wrote: > > Hello, > > What is the best way to track down these types of errors? > > in ntw.urls I have: (r'^checkout/', include('checkout.urls'))

Re: No module named models again

2013-02-06 Thread Brad
On Wed, 2013-02-06 at 11:49 -0800, frocco wrote: > Line 22 does not make any sense to me as to why it is failing. > If I remove receipt, it runs fine It can be surprising sometimes what code can cause other code to get imported and run. My guess is, in trying to find your url route there, Django l

Django and mod_wsgi serving different apps from separate virtual hosts on the same server

2013-02-06 Thread robertlnewman
Hi fellow Django devs, I have been going around and around trying to figure this out for 2 days, without success. I am trying to serve two Django sites from one webserver using Apache's virtual hosts. The first works, the second doesn't. (Note that I have been happily serving Django content via

Why doesn't form_valid() in FormView take a request argument?

2013-02-06 Thread Some Developer
Why doesn't the form_valid() (and for that matter the form_invalid()) method in the FormView generic class based view take a request argument? I've found that if you have a form which requires you to override the form_valid() method because you need to do custom logic before you save the model

Re: Maintenance on djangoproject.com tomorrow

2013-02-06 Thread Sergei V
Hi, is it a smell of next RC in the air? :) regards, Sergei On Wednesday, February 6, 2013 8:43:38 PM UTC+2, Aymeric Augustin wrote: > > Hi folks, > > We've scheduled maintenance operations on djangoproject.com tomorrow, > starting at 09:00 UTC. > > The website and the docs may be temporarily

Re: Problen with Custom command and Bash Script

2013-02-06 Thread Mike Dewhirst
On 7/02/2013 12:39am, Jesús Lucas Flores wrote: Hey guys, I need a little bit help with a custom manage.py command called *test* There is already a manage.py subcommand called test. Might be an idea to rename your custom command and try again. Just a thought ... I am using it in a vi

Re: Problen with Custom command and Bash Script

2013-02-06 Thread Jesús Lucas Flores
Hi guys, Thanks everybody for all the answers, really helped me. I *SOLVED the problem.* The problem was I was calling custom enviroment variables into my settings.py . So that enviroments variables exists on bash (thanks to .bashrc) but not in cron ( thanks Branko Majic ) so manage.py failed

Re: Need guidance on static website conversion to Django

2013-02-06 Thread Harry Houdini
Maintaining that many static files has really got to suck, this is where Django is going to help you a lot. First step for you because you are just starting out it to play around with Django, build some base templates and try extending them until you get your templates looking how you want. The

Re: Why doesn't form_valid() in FormView take a request argument?

2013-02-06 Thread Rainy
On Wednesday, February 6, 2013 3:09:39 PM UTC-5, Some Developer wrote: > > Why doesn't the form_valid() (and for that matter the form_invalid()) > method in the FormView generic class based view take a request argument? > > I've found that if you have a form which requires you to override the

Re: Automating deployments

2013-02-06 Thread Barry Morrison
I've got SaltStack setup to deploy Ubuntu+Nginx+uWSGI+Postgresql+memcache pretty easily. Pulls Django projects from Git, pip installs from requirements file. It is a lot less complicated than Puppet/Chef in my opinion. Just my $.03 cents On Friday, February 1, 2013 4:28:45 PM UTC-8, Marc A

Re: No module named models again

2013-02-06 Thread frocco
I found the answer. in my app directory called checkout, I also have a checkout.py file. from checkout.models import Order in views.py had to be changed to from models import Order On Wednesday, February 6, 2013 3:02:57 PM UTC-5, Brad Pitcher wrote: > > On Wed, 2013-02-06 at 11:49 -0800, frocco w

Access to data via many-to-many while in save()

2013-02-06 Thread Derek
I am trying to access the field(s) of a Child table while still inside the save method of the Parent table. Assuming that the many-to-many field in the Parent table is called `m2m_field`, and the field I need to access in the Child table is called `child_field`, what I have tried is this: def sav

Re: Object level permissions implementation

2013-02-06 Thread Jani Tiainen
That's something I had in mind also. And I think that is quite a best thing to do. 6.2.2013 18:09, bobhaugen kirjoitti: I'm not sure this is the best way to do it, but for what I think is a similar situation, I created a template tag and a model instance method. The template tag asks the model

Re: Access to data via many-to-many while in save()

2013-02-06 Thread Mike Dewhirst
On 7/02/2013 5:04pm, Derek wrote: I am trying to access the field(s) of a Child table while still inside the save method of the Parent table. Assuming that the many-to-many field in the Parent table is called `m2m_field`, and the field I need to access in the Child table is called `child_field`,