Re: Django setup problem when executing syncdb

2009-03-02 Thread bvemu
Hi All I apologise for posting a wrong answer , thanks karen for correcting it btw is it also applicable on linux I have been searching for MySQLdb for python 2.6 on linux and could not find it Thanks Vemu On Mar 2, 10:34 pm, Karen Tracey wrote: > On Mon, Mar 2, 2009 at 12:03 PM, bvemu wrote

Generating dynamic csv data

2009-03-02 Thread GP
I have a view which generates a table (table_view) of the most recent entries entered in the Test table of the database. I have the option of querying the database and render the table based on the user criteria as well Something like this: tests = Test.objects.filter(field1 = ...) The searc

Is ODBC supported so to use DB's like Access, Teradata?

2009-03-02 Thread KG
What needs to be done to make use of any other DB engine thru ODBC? Thanks in advance KG --~--~-~--~~~---~--~~ 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@google

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Graham Dumpleton
On Mar 3, 4:00 pm, Wiiboy wrote: > So, is getting mod_python and Django worth ditching my current > provider, and a dollar more a month? Be careful of web hosting companies offering mod_python. If they also provide you with your own Apache instance which is under your full control (like WebFacti

Re: newbie problem -- import django fails

2009-03-02 Thread Dan Mallinger
It sounds like it's still the problem of django-admin.py not being in your path. In order to script a file like this from any directory, the os needs to know about the script - which is done by adding it to your path. On Unix, we generally make links to these files in /usr/local, on Windows, you c

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Alex Gaynor
On Tue, Mar 3, 2009 at 12:00 AM, Wiiboy wrote: > > So, is getting mod_python and Django worth ditching my current > provider, and a dollar more a month? > > > I prefer mod_wsgi, but as a rule, yes getting proper support from your host, and a commitment that it will work is easily work a dollar to

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Wiiboy
So, is getting mod_python and Django worth ditching my current provider, and a dollar more a month? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: newbie problem -- import django fails

2009-03-02 Thread kkaste
Thank you for your quick response (and your patience). The following command worked: C:\Python26\Lib\site-package\django\bin> django-admin.py startproject mysite It created C:\Python26\Lib\site-package\django\bin\mysite containing the necessary files. The \django\bin subdirectory contains the file

Template error

2009-03-02 Thread xankya
This works fine in my computer. but in remote server the following error is shown: Template error In template /opt/local/lib/python2.4/site-packages/django/contrib/ comments/templates/comments/form.html, error at line 2 Caught an exception while rendering: Reverse for '' with arguments '()' and

Re: newbie problem -- import django fails

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 11:05 PM, kkaste wrote: > > Thanks for your quick response. Once I switched from the DOS command > line to the Python prompt I got "import django" to work. The next dumb > mistake I am making comes when I type django-admin.py startproject > mysite at the Python prompt. I ge

Re: newbie problem -- import django fails

2009-03-02 Thread kkaste
Thanks for your quick response. Once I switched from the DOS command line to the Python prompt I got "import django" to work. The next dumb mistake I am making comes when I type django-admin.py startproject mysite at the Python prompt. I get the following error: File "", line 1 django-admin.py sta

Re: problem about "You appear not to have the 'sqlite3' program installed or on your path."

2009-03-02 Thread jason
another question, but where should i put the 'sqlite3.exe' in order to use the 'python manage.py dbshell' command? On Mar 3, 10:48 am, jason wrote: > understood. thanks very much:-) > > On Feb 26, 8:03 pm, Ramiro Morales wrote: > > > > > On Thu, Feb 26, 2009 at 9:51 AM, jason zones wrote: > >

Re: problem about "You appear not to have the 'sqlite3' program installed or on your path."

2009-03-02 Thread jason
understood. thanks very much:-) On Feb 26, 8:03 pm, Ramiro Morales wrote: > On Thu, Feb 26, 2009 at 9:51 AM, jason zones wrote: > > hello, all. > > i have a problem when i type "python manage.py dbshell" in the commandline > > within the mysite folder. i used sqlite3 as the db. > > when i typed

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Wiiboy
http://djangofriendly.com/hosts/mochahost/ Yes they do. They don't have any reviews --~--~-~--~~~---~--~~ 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@googleg

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 8:33 PM, Wiiboy wrote: > > Do you guys know anything about MochaHost? > http://www.mochahost.com/webhosting.php > > > Sounds way to good to be true. . .Which probably isn't good. > > > http://djangofriendly.com/hosts/ is a good resource for reviews of Django hosts, that bei

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Wiiboy
Do you guys know anything about MochaHost? http://www.mochahost.com/webhosting.php Sounds way to good to be true. . .Which probably isn't good. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: newbie problem -- import django fails

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 8:20 PM, kkaste wrote: > > I followed the instructions for installing django. Apparently this was > successful because I have a folder named django under the site- > packages folder of Python26, and a file named django-admin.py in the > bin folder under that. So with that s

newbie problem -- import django fails

2009-03-02 Thread kkaste
I followed the instructions for installing django. Apparently this was successful because I have a folder named django under the site- packages folder of Python26, and a file named django-admin.py in the bin folder under that. So with that success under my belt, I followed the prompts on the djang

Re: two html and django forms on a page issue?

2009-03-02 Thread Malcolm Tredinnick
On Mon, 2009-03-02 at 16:12 -0800, zweb wrote: > I have two html forms on a page. Each html form has a django form > associated. > One form has validations. > When I submit the form (form1) which does not have validations, it > submit the other form (form2) on page as well and triggers the > valid

Re: Django bilingual web site

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 7:31 PM, tdelam wrote: > > Hey everyone. I would like to create a simple bilingual web site. Does > anyone have any tips how I can accomplish this with Django? Basically > a typical bilingual web site, click "french" french content is > presented and vice versa for english.

Django bilingual web site

2009-03-02 Thread tdelam
Hey everyone. I would like to create a simple bilingual web site. Does anyone have any tips how I can accomplish this with Django? Basically a typical bilingual web site, click "french" french content is presented and vice versa for english... Any suggestions would help. --~--~-~--~

two html and django forms on a page issue?

2009-03-02 Thread zweb
I have two html forms on a page. Each html form has a django form associated. One form has validations. When I submit the form (form1) which does not have validations, it submit the other form (form2) on page as well and triggers the validation on the form2. I do not want the form2 to validate on

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 7:02 PM, Wiiboy wrote: > > How would using Django be any different than having a very large > Python script? > > > It's not really, in the WSGI case you basically point the server at a callable and it passes the callable some parameters and gets a response back in some form

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Wiiboy
How would using Django be any different than having a very large Python script? --~--~-~--~~~---~--~~ 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

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Graham Dumpleton
On Mar 3, 10:25 am, Wiiboy wrote: > I'm with a shared hosting company called Lunarpages.  They tell me > Django, by itself, even with Fast CGI, because it is a framework, is > too resource intensive for them to allow.  But many other shared > hosting providers allow Django.  So, how do those who

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread James Bennett
On Mon, Mar 2, 2009 at 6:25 PM, Wiiboy wrote: > I'm with a shared hosting company called Lunarpages.  They tell me > Django, by itself, even with Fast CGI, because it is a framework, is > too resource intensive for them to allow.  But many other shared > hosting providers allow Django.  So, how d

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Malcolm Tredinnick
On Mon, 2009-03-02 at 15:25 -0800, Wiiboy wrote: > I'm with a shared hosting company called Lunarpages. They tell me > Django, by itself, even with Fast CGI, because it is a framework, is > too resource intensive for them to allow. But many other shared > hosting providers allow Django. So, how

Re: Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 6:25 PM, Wiiboy wrote: > > I'm with a shared hosting company called Lunarpages. They tell me > Django, by itself, even with Fast CGI, because it is a framework, is > too resource intensive for them to allow. But many other shared > hosting providers allow Django. So, how

Why do some shared hosting providers support Django and others don't?

2009-03-02 Thread Wiiboy
I'm with a shared hosting company called Lunarpages. They tell me Django, by itself, even with Fast CGI, because it is a framework, is too resource intensive for them to allow. But many other shared hosting providers allow Django. So, how do those who do allow it allow users to use it without b

Re: template blocks inside include?

2009-03-02 Thread Roy
*bump* anyone have any idea on this? On Mar 1, 9:17 pm, Roy wrote: > Hi group, > > Say I have the ff in my base.html: > > {% include template_name %} > > And template_name is a variable that resolves to some template path, > let's say the file at that path contains the following: > > {% block co

Re: How can I get a queryset in new view from template?

2009-03-02 Thread Malcolm Tredinnick
On Mon, 2009-03-02 at 23:51 +0100, KrcK wrote: > Hi, > > I would like to know how can I do the next. > I want to put a queryset into a context and > then use render_to_response() to render one template like example.html, > which contains one form with some hidden fields. This form submits data to

Many-to-many filters on multiple conditions

2009-03-02 Thread Malcolm Tredinnick
Ahem! You have hijacked an existing thread and your post isn't about installing on a Mac. I've change the topic, but please start a new thread next time. On Mon, 2009-03-02 at 23:28 +0100, Marek Wawrzyczek wrote: > Hi_ > _ > At: > http://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-

How can I get a queryset in new view from template?

2009-03-02 Thread KrcK
Hi, I would like to know how can I do the next. I want to put a queryset into a context and then use render_to_response() to render one template like example.html, which contains one form with some hidden fields. This form submits data to another url and I've to use another view to do it. The pro

Re: dynamic filter m2m field

2009-03-02 Thread Malcolm Tredinnick
On Mon, 2009-03-02 at 13:59 -0800, natx...@gmail.com wrote: > I'm trying to make a complex dynamic filter. The first thing I've done > is get dynamically a list of list of titles, something like this: > > [[, Educación>], []] > > and a way to add/remove list of titles to/from the general list (

Re: Problem routing to certain i18n locales/languages

2009-03-02 Thread Malcolm Tredinnick
On Mon, 2009-03-02 at 11:24 -0800, Scott wrote: > Hi Malcolm, > > Thanks for your response, I suspected that it was something similar. > I'm actually using the Django helper for App Engine (http:// > code.google.com/p/google-app-engine-django/), so there is no django > installation to configure.

Re: View design patterns for inherited templates

2009-03-02 Thread Malcolm Tredinnick
On Mon, 2009-03-02 at 05:00 -0800, Daniel Roseman wrote: > On Mar 2, 10:41 am, Mattias wrote: > > Hi, > > > > I'm just learning Django, and had a question with my first site. > > > > To have a common layout for multiple pages (even those in different > > applications / python code folders) on the

Re: Cookie problem on multiple sites

2009-03-02 Thread Malcolm Tredinnick
On Mon, 2009-03-02 at 03:05 -0800, Dids wrote: > Thanks for your input. > > > Reading the following > > > Even non-logged in users have a session associated with them, which > > Django uses a cookie to track. > > I did point the browser to the non-admin pages (available to all , no > @login_re

Re: How to compare two different types in templates using ifequal

2009-03-02 Thread Malcolm Tredinnick
On Mon, 2009-03-02 at 01:41 -0800, eli wrote: [...] > I have no idea where is the bug... In all cases you are likely making assumptions about what the filters are returning that are likely not correct. One way Insert the values of the filters into your template and have a look at what they are re

Re: Help w/ installing admin on 1.0.2 on MAC OS 10.4

2009-03-02 Thread Marek Wawrzyczek
Sorry, I wanted to begin a new topic, and I've forgotten to change the subject. Best wishes, Marek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Re: mod_python error when debug=False

2009-03-02 Thread Danny Brown
I guess I will try tomorrow . Don't know if I know enough about Django to make an intelligent submittal but will try. On Mon, Mar 2, 2009 at 3:43 PM, Karen Tracey wrote: > On Mon, Mar 2, 2009 at 3:48 PM, Danny Brown wrote: >> >> Thanks to Karen, She figured it out. I guess she will know if it >

basics: filtering with foreign key

2009-03-02 Thread Marek Wawrzyczek
Hi At: http://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-valued-relationships there is written: "That may sound a bit confusing, so hopefully an example will clarify. To select all blogs that contains entries with "Lennon" in the headline and were published in 2008, we

Re: Help w/ installing admin on 1.0.2 on MAC OS 10.4

2009-03-02 Thread Marek Wawrzyczek
Hi_ _ At: http://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-valued-relationships there is written: / "That may sound a bit confusing, so hopefully an example will clarify. To select all blogs that contains entries with "Lennon" in the headline and were published in 2008

Re: Help w/ installing admin on 1.0.2 on MAC OS 10.4

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 5:00 PM, Chip wrote: > > I've been successfully working my way thru the Django book to learn > how to use Django to develop a simple community site UNTIL I tried to > get the admin site going. All went ok on model validation. I edited > urls.py as advised and then got t

Help w/ installing admin on 1.0.2 on MAC OS 10.4

2009-03-02 Thread Chip
I've been successfully working my way thru the Django book to learn how to use Django to develop a simple community site UNTIL I tried to get the admin site going. All went ok on model validation. I edited urls.py as advised and then got this error when trying to fire up admin... any ideas on

dynamic filter m2m field

2009-03-02 Thread natxooy
I'm trying to make a complex dynamic filter. The first thing I've done is get dynamically a list of list of titles, something like this: [[, ], []] and a way to add/remove list of titles to/from the general list (let's call it big list). Is there a way to filter a list of Persons that have Titl

Re: Django not deleting files still referenced by ImageField

2009-03-02 Thread Karen Tracey
On Mon, Mar 2, 2009 at 4:47 PM, James wrote: > > So I added a custom storage class to an ImageField which overwrites > files with the same name. > > I noticed while testing that I can add many records all referencing > the same single image, which gets overwritten with each new record > created.

Re: Django not deleting files still referenced by ImageField

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 4:47 PM, James wrote: > > So I added a custom storage class to an ImageField which overwrites > files with the same name. > > I noticed while testing that I can add many records all referencing > the same single image, which gets overwritten with each new record > created.

Django not deleting files still referenced by ImageField

2009-03-02 Thread James
So I added a custom storage class to an ImageField which overwrites files with the same name. I noticed while testing that I can add many records all referencing the same single image, which gets overwritten with each new record created. What's strange/interesting is... the image file doesn't ge

Re: Signals getting sent twice

2009-03-02 Thread iris
Dear Steve, Thank you for saving hours and hours of my team's time. On Feb 17, 5:10 am, stevedegrace wrote: > Figured it out myself... you have to set dispatch_uid for the connect > methods. See modification below to the last three lines of my example > above. It's still annoying that the overh

Re: mod_python error when debug=False

2009-03-02 Thread Karen Tracey
On Mon, Mar 2, 2009 at 3:48 PM, Danny Brown wrote: > > Thanks to Karen, She figured it out. I guess she will know if it > should be a ticket. I am like you. I sure don't know. > Probably worth a ticket so it doesn't get forgotten; I won't be able to experiment with an Apache setup until the week

Re: Django development workflow

2009-03-02 Thread Gour
> "Clifford" == CLIFFORD ILKAY writes: Clifford> It's entirely up to you. You could use your database's Clifford> dump/load facilities, which would be the highest Clifford> performance. You could dump/load using a Python script and the Clifford> Django ORM. You could dump using "django-admin.

Re: Postgis on Mac OS Leopard

2009-03-02 Thread omat * gezgin.com
In the end, I made an upgrade to PostgreSQL 8.3 and clean installations of PostGIS and related libraries using binary packages. It still required some manual fixing of paths but I managed to get it going in the end. Thanks. On Feb 27, 1:33 pm, Graham Dumpleton wrote: > On Feb 27, 10:23 pm, "o

Re: mod_python error when debug=False

2009-03-02 Thread Danny Brown
Thanks to Karen, She figured it out. I guess she will know if it should be a ticket. I am like you. I sure don't know. On Mon, Mar 2, 2009 at 2:43 PM, Michael A. Repucci wrote: > Hey thanks Danny!! That worked! The quoted strings syntax should be > permissible, and works just fine with DEBUG=Tru

Re: mod_python error when debug=False

2009-03-02 Thread Michael A. Repucci
Hey thanks Danny!! That worked! The quoted strings syntax should be permissible, and works just fine with DEBUG=True, or on the development server. I'd say this should be a new ticket, but what do I know. I'm just a user not a developer. Anyway, thanks again! On Mon, Mar 2, 2009 at 3:17 PM, Danny

Re: ModelMultipleChoiceField

2009-03-02 Thread natxooy
Thanks!! that works On 2 mar, 19:26, Alex Gaynor wrote: > On Mon, Mar 2, 2009 at 12:42 PM, wrote: > > > I've got an error using ModelMultipleChoiceField, but don't guess > > where: > > > my form is : > > > class SearchForm(forms.Form): > >    titulos = forms.ModelMultipleChoiceField(Titulo.obje

Re: Admin Pages - want horizontal scroll ability

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 3:23 PM, Peter Bailey wrote: > > Yeah, I have big objects in tables. Sigh, was hoping to avoid writing > more css, but thought it might come down to that. > > Thanks Alex. > > > On Mar 2, 3:09 pm, Alex Gaynor wrote: > > On Mon, Mar 2, 2009 at 3:06 PM, Peter Bailey > wrote

Re: Admin Pages - want horizontal scroll ability

2009-03-02 Thread Peter Bailey
Yeah, I have big objects in tables. Sigh, was hoping to avoid writing more css, but thought it might come down to that. Thanks Alex. On Mar 2, 3:09 pm, Alex Gaynor wrote: > On Mon, Mar 2, 2009 at 3:06 PM, Peter Bailey wrote: > > > Hello, I am building a small app that just requires admin > >

Re: mod_python error when debug=False

2009-03-02 Thread Danny Brown
using syntax like this : contact = models.ForeignKey("Contact" was causing me to fail earlier today at the exact same line. her response to me was "Why are you using quoted strings instead of direct references to the target models here and in the OneToOneField in VoipGateway? I don't understand

Re: Admin Pages - want horizontal scroll ability

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 3:06 PM, Peter Bailey wrote: > > Hello, I am building a small app that just requires admin > functionality, Thought I was about done, but my customer tried it on a > huge 1024x768 monitor (have not seen one for a few years). Turns out > the if the admin pages would slide ho

Admin Pages - want horizontal scroll ability

2009-03-02 Thread Peter Bailey
Hello, I am building a small app that just requires admin functionality, Thought I was about done, but my customer tried it on a huge 1024x768 monitor (have not seen one for a few years). Turns out the if the admin pages would slide horizontally as well as vertically, things would be fine. Works r

Re: filter with respect to single attribute does not work properly

2009-03-02 Thread limas
Thank you Alex . It works thank you very much. Lima On Mar 3, 12:59 am, Alex Gaynor wrote: > On Mon, Mar 2, 2009 at 2:56 PM, limas wrote: > > > thank you Alex for your valuable reply. > > but i am still not able to find out the solution. > > i tried this: > > dataobj=DataValue.objects.filt

Re: filter with respect to single attribute does not work properly

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 2:56 PM, limas wrote: > > thank you Alex for your valuable reply. > but i am still not able to find out the solution. > i tried this: > dataobj=DataValue.objects.filter(Q(file=file.id)|Q(mnem=1)|Q(mnem=2)) > but it is not working fine. it is returning every thing. > > can

Re: filter with respect to single attribute does not work properly

2009-03-02 Thread limas
thank you Alex for your valuable reply. but i am still not able to find out the solution. i tried this: dataobj=DataValue.objects.filter(Q(file=file.id)|Q(mnem=1)|Q(mnem=2)) but it is not working fine. it is returning every thing. can you suggest some thing more. It will realy help a newbie like

FileUploadHandler not called in realtime

2009-03-02 Thread TK
Hi, I've got a problem with limiting the maximum size of a file uploaded to my webapp. I subclassed FileUploadHandler and everything is working fine, but only with Django development server. When running on lighttpd or nginx with mod_fastcgi (actually it behaves the same with apache + mod_python)

Re: filter with respect to single attribute does not work properly

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 2:36 PM, limas wrote: > > Hello. > > my project deals with mnemonic-data pairs. > so I have model like this: > > class DataValue(models.Model): >file=models.ForeignKey(File) >row=models.IntegerField() >mnem=models.IntegerField() >value=mo

Re: mod_python error when debug=False

2009-03-02 Thread Michael A. Repucci
Thanks for walking me through the traceback Karen. I'm happy to post my models.py and admin.py code here (or whatever else might help), but I don't ever explicitly check settings.DEBUG in any of my code, so I'm at a bit of a loss where the error might be coming from. Any further suggestions? #peop

filter with respect to single attribute does not work properly

2009-03-02 Thread limas
Hello. my project deals with mnemonic-data pairs. so I have model like this: class DataValue(models.Model): file=models.ForeignKey(File) row=models.IntegerField() mnem=models.IntegerField() value=models.CharField(max_length=2000) class Curve(models.Model):

Re: Problem routing to certain i18n locales/languages

2009-03-02 Thread Scott
Hi Malcolm, Thanks for your response, I suspected that it was something similar. I'm actually using the Django helper for App Engine (http:// code.google.com/p/google-app-engine-django/), so there is no django installation to configure. Further to this, all of the strings are being provided by ou

Re: X-Sendfile

2009-03-02 Thread Katja L.
OK, I found the error ... Our student worker forgot to enable xsendfile ;). Thanks! Katja --~--~-~--~~~---~--~~ 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@googl

Re: Help with Singletons

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 12:56 PM, Dan wrote: > > Hi everyone, > > I'm trying to create some lazy querying classes in my code to minimize > the number of queries run per request. Suppose, for example, I wanted > to store all the comments on a site in a variable, cached_comments, > which is part of

Re: ModelMultipleChoiceField

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 12:42 PM, wrote: > > I've got an error using ModelMultipleChoiceField, but don't guess > where: > > my form is : > > class SearchForm(forms.Form): >titulos = forms.ModelMultipleChoiceField(Titulo.objects.all > ().order_by('tipo'), label='Títulos') > > in my template I i

X-Sendfile

2009-03-02 Thread Katja L.
Hey, it's not really a Django question but maybe someone has an idea :). I have the following method: def sendfile(request, dataset_id): ds = DataSet.objects.select_related().get(id=dataset_id) filename = ds.table_information.object_name response = HttpResponse() response['X-Sendfile']

Help with Singletons

2009-03-02 Thread Dan
Hi everyone, I'm trying to create some lazy querying classes in my code to minimize the number of queries run per request. Suppose, for example, I wanted to store all the comments on a site in a variable, cached_comments, which is part of an application, Blog. (Note, I'm not actually doing anyt

ModelMultipleChoiceField

2009-03-02 Thread natxooy
I've got an error using ModelMultipleChoiceField, but don't guess where: my form is : class SearchForm(forms.Form): titulos = forms.ModelMultipleChoiceField(Titulo.objects.all ().order_by('tipo'), label='Títulos') in my template I insert it with: {% for field in form %} {{ field.label

template error

2009-03-02 Thread xankya
This works fine in my computer. but in remote server the following error is shown: Template error In template /opt/local/lib/python2.4/site-packages/django/contrib/ comments/templates/comments/form.html, error at line 2 Caught an exception while rendering: Reverse for '' with arguments '()' and

Re: Django setup problem when executing syncdb

2009-03-02 Thread Karen Tracey
On Mon, Mar 2, 2009 at 12:03 PM, bvemu wrote: > > Hi Ches > > The issue is that you are using python version 2.6 for which there is > no support from the MySQLdb package This is not true. A pointer to a binary of MySQLdb for Python 2.6 on Windows was posted a while ago, AKK referred to it ea

Re: AttributeError: 'str' object has no attribute '_default_manager' from related.py django 1.0.2

2009-03-02 Thread Danny Brown
Briel: Thanks, Karen was right. Regarding pastebin, amount of text pasted. This is in direct response from someone on the IRC , I suspect it is Karen wanting this information. Asking for more info than could be given on IRC. Also, I did paste to dpaste but no one has attempted. Regarding specific

Re: AttributeError: 'str' object has no attribute '_default_manager' from related.py django 1.0.2

2009-03-02 Thread Dan
Thanks, that seems to be what was wrong. At least now I get a database error. Still trying to figure it out. Not related I am sure. Removed quoted references and the error went away. On Mar 2, 10:58 am, Karen Tracey wrote: > On Mon, Mar 2, 2009 at 11:11 AM, Dan wrote: > > > AttributeError: 'str

Re: AttributeError: 'str' object has no attribute '_default_manager' from related.py django 1.0.2

2009-03-02 Thread Briel
Hi You really dont make it easy for others to help you out. It would be great if post info like, when the problem occurs like only specific urls and just post the relevant info instead of posting a huge wall of text that makes it a lot harder to find out where the problem is. Also using something

Re: Django setup problem when executing syncdb

2009-03-02 Thread bvemu
Hi Ches The issue is that you are using python version 2.6 for which there is no support from the MySQLdb package so you have to downgrade your python version to 2.5.4 and let your PYTHONPATH point to that (for example I am using SLE 11.1 henceforth placed the bin of python 2.5.4 in my /home/s

Re: AttributeError: 'str' object has no attribute '_default_manager' from related.py django 1.0.2

2009-03-02 Thread Karen Tracey
On Mon, Mar 2, 2009 at 11:11 AM, Dan wrote: > > AttributeError: 'str' object has no attribute '_default_manager' from > related.py django 1.0.2 > ---get this error when > accessing any part of site > - > M

AttributeError: 'str' object has no attribute '_default_manager' from related.py django 1.0.2

2009-03-02 Thread Dan
AttributeError: 'str' object has no attribute '_default_manager' from related.py django 1.0.2 ---get this error when accessing any part of site - MOD_PYTHON ERROR ProcessId: 2637 Interpreter:'TS1.

Re: Media Root & Templates

2009-03-02 Thread AKK
I added a comma and it worked fine. And i've learned something, i only thought you needed a comma if there where multiple items. Many Thanks, Andrew On 2 Mar, 00:10, Malcolm Tredinnick wrote: > On Sun, 2009-03-01 at 14:40 -0800, AKK wrote: > > Is this what you mean? > > > TEMPLATE_CONTEXT_PROC

http://code.google.com/p/django-ajax-selects/

2009-03-02 Thread felix
I've posted a working first draft for many-to-many and foreign-key lookups using jQuery. Works for any form including in the admin -f --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: TemplateDoesNotExist at /admin/ on Linux (Xubuntu) while doing Django Tutorial 2

2009-03-02 Thread Karen Tracey
On Sun, Mar 1, 2009 at 10:56 PM, Chris Verehhotti < chris.peresso...@gmail.com> wrote: > > > however, in my Thunar file viewer, every icon has a little "X" on it > > -- this makes me think it's a permissions issue, but I'm a Linux n00b > > and am not sure how to go about fixing this. Do I need to

Re: Forms with dynamic *fields*

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 9:03 AM, GRoby wrote: > > Hello Martin, > > I had a similar need and did the following: > > Use the Dynamic Django form class from > http://www.djangosnippets.org/snippets/714/ > > An Example of how the form is built in my view (just a cleaned up C&P > snippet from my code)

Re: how to create a registration with the UserCreationForm fields and an optional email field?

2009-03-02 Thread Alex Gaynor
On Mon, Mar 2, 2009 at 7:44 AM, localhorst.1...@gmail.com < localhorst.1...@gmail.com> wrote: > > hi, > the UserCreationForm has only the fields username, password and > password again. > But i want an optional emailfield in my registration. > > i read the overriding a ModelForm part in the docume

Re: 'Latest' foreign key template filter?

2009-03-02 Thread Allfonso
Aha, Found solution myself. Any newbies trying to pull the latest item of anything... under your model definition, set a meta class with the following: class Meta: get_latest_by = "some_datefield" Then in your template simply use something like the following: {{ object.product_sell_price

Re: Forms with dynamic *fields*

2009-03-02 Thread GRoby
Hello Martin, I had a similar need and did the following: Use the Dynamic Django form class from http://www.djangosnippets.org/snippets/714/ An Example of how the form is built in my view (just a cleaned up C&P snippet from my code): FormDictionary=BuildForm(NumberOfSpecialFields)

Re: Problem with admin validation

2009-03-02 Thread Joshua Russo
Ok, I figured out what was going on. I was testing some custom save logic and was just reloading the page to have my browser (Firefox) resend the post data. The validation of the inline models works just fine if I come into the model change page normally. On Feb 27, 7:29 pm, Joshua Russo wrote:

Re: How to compare two different types in templates using ifequal

2009-03-02 Thread Darek
On Mar 2, 11:41 am, Alex Koshelev wrote: > Just now {% ifequal %} doesn't support filter expressions as arguments. So > you must prepare values by {% with %} tag before using them in {% ifequal > %}. Thank You, I will try it later.. ps. I'm sorry for double-post. --~--~-~--~~--

A new command(create_app) for django, auto generate CRUD files and methods(view/urls/template)

2009-03-02 Thread vicalloy
== Introduce == A command(create_app) for django, auto generate CRUD file and method(view/urls/template). you can download from: http://vik.haoluobo.com/blog/wp-content/uploads/2009/03/hidjangoen.zip == how to use == Put django_extensions folder to you project app directory, and add django_extensi

Re: Docstring documentation

2009-03-02 Thread motard
This wasn't working in my case because further down the code I was creating a new variable with the same name as the function. Doing that I was effectively overwriting my own function. And therefore did not have access anymore to it's __doc__ property. Regards, Stefan On Feb 27, 11:29 am, Ned B

Re: View design patterns for inherited templates

2009-03-02 Thread Daniel Roseman
On Mar 2, 10:41 am, Mattias wrote: > Hi, > > I'm just learning Django, and had a question with my first site. > > To have a common layout for multiple pages (even those in different > applications / python code folders) on the site, I'm using template > inheritance. > But the base template uses a

how to create a registration with the UserCreationForm fields and an optional email field?

2009-03-02 Thread localhorst.1...@gmail.com
hi, the UserCreationForm has only the fields username, password and password again. But i want an optional emailfield in my registration. i read the overriding a ModelForm part in the documentation and i tried this: >>> class UserCreationFormExtended(ModelForm): ... email = model.EmailField() ..

Re: How to reverse lookup a RSS feed url?

2009-03-02 Thread Rama Vadakattu
On Mar 2, 1:10 pm, Malcolm Tredinnick wrote: > On Mon, 2009-03-02 at 00:02 -0800, Rama Vadakattu wrote: > > Thanks Malcolm.Understood very clearly. > > > Following the same approach i have used following code in my templates > > {% url djorum_feed_url   category.getCategoryString %} > > > categ

View design patterns for inherited templates

2009-03-02 Thread Mattias
Hi, I'm just learning Django, and had a question with my first site. To have a common layout for multiple pages (even those in different applications / python code folders) on the site, I'm using template inheritance. But the base template uses a few variables, for example the name of the logged

How to compare two different types in templates using ifequal

2009-03-02 Thread eli
Hi, I have a problem (Django 1.1. alpha SVN): Python: week = [1, 2, 3, 4, 5, 6, 7] # There are only two records in objects_list with date_start field = 01.01.2000 and 02.01.2000 objects_list = SomeModel.objects.all() Template: {% for day in week %} {% for e in objects_list %} {# date:"j

Re: Cookie problem on multiple sites

2009-03-02 Thread Dids
Thanks for your input. Reading the following > Even non-logged in users have a session associated with them, which > Django uses a cookie to track. I did point the browser to the non-admin pages (available to all , no @login_required). It works fine, I can see the pages in IE, but no cookies a

Re: How to compare two different types in templates using ifequal

2009-03-02 Thread Alex Koshelev
Just now {% ifequal %} doesn't support filter expressions as arguments. So you must prepare values by {% with %} tag before using them in {% ifequal %}. On Mon, Mar 2, 2009 at 12:22 PM, eli wrote: > > Hi, > > I have a problem: > > Python: > week = [1, 2, 3, 4, 5, 6, 7] > # There are only two re

  1   2   >