Logging SQL queries

2011-05-24 Thread candlerb
I have Django 1.3 installed, and would like the built-in 'runserver' to show me the SQL queries it is executing. I found this thread: http://groups.google.com/group/django-users/browse_thread/thread/9ed3ea72afc02ee8/a5df8c062640d063?show_docid=a5df8c062640d063&fwc=1&pli=1 However, after reading t

Re: Logging SQL queries

2011-05-24 Thread candlerb
On May 24, 5:28 pm, Shawn Milochik wrote: > Here's a handler: ... > Here's a logger: Thank you. I tried this and it still didn't log my SQL queries. Then I went through the documentation again, and found that I should have configured "django.db.backends" instead of "django.db.backend". It's work

TabularInline - getting rid of 'original' row

2011-05-24 Thread candlerb
I've built the 'tutorial' poll application under Django 1.3. One thing I notice is that when viewing the choices shown inline under the poll, each choice has an extra heading piece of text. For example, I could see Choices Not much [Not much ] [0] The Sky [The Sky ] [

Confusing path example for mod_wsgi?

2011-07-04 Thread candlerb
The example given in `django/docs/howto/deployment/modwsgi.txt` shows: os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' ... path = '/path/to/mysite' if path not in sys.path: sys.path.append(path) However, when deploying a project I found that I had to include

Re: Confusing path example for mod_wsgi?

2011-07-04 Thread candlerb
On Jul 4, 4:29 pm, Tom Evans wrote: > If you have setup your folder layout like this: > /path/to > foo/ > settings.py > bar/ > Where 'foo' is your project and 'foo.bar' is your app, then you will > need to add /path/to to sys.path. > If on the other hand 'bar' is how you refer to your ap

Re: Confusing path example for mod_wsgi?

2011-07-05 Thread candlerb
Thanks Tom and Bruno for all the help - my project looks much cleaner now. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-

Related model getting autocomplete="off"

2011-07-05 Thread candlerb
I have an Admin view on a model which has related (child) models. I have extra=1. It displays like this: [Child1] [Child2] [ ] + Add another Foo I have jQuery autocomplete attached to those model fields. All is fine, except: when I click on 'Add another Foo', the dynamically added field has

Re: Related model getting autocomplete="off"

2011-07-05 Thread candlerb
Sorry, please ignore this question. All rows get autocomplete="off", and it doesn't make adifference. The problem than autocomplete() doesn't work like live(): if you call autocomplete() and then later add a new field to the DOM, that new field doesn't get autocomplete enabled. -- You received

Model IPAddressField not validating?

2011-07-05 Thread candlerb
I have a model defined as follows with an IPAddressField: class Nas(models.Model): name = models.CharField(max_length=128) ip = models.IPAddressField('IP Address', max_length=15, unique=True) nas_type = models.CharField('NAS Type', max_length=32, blank=True) huntgroup = models

Re: Model IPAddressField not validating?

2011-07-05 Thread candlerb
On Jul 5, 5:34 pm, Tom Evans wrote: > from django.core.validators import validate_ipv4_address > ... >     ip = models.IPAddressField(..., validators=[validate_ipv4_address]) This works perfectly, thank you. (Maybe worth a note in ref/models/ fields.html though?) Cheers, Brian. -- You receive