Re: TemplateSyntaxError No module name utils

2008-12-10 Thread Milan Andric
On Dec 10, 8:52 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > I'm getting one of those bubbly exceptions coming through the template > that are tricky to debug. > > TemplateSyntaxError at / > Caught an exception while rendering: Could not import > journalism_mm.workshops.views. Error was: No

Re: request parsing

2008-12-10 Thread Vicky
Thanks a lot man. That site really helped me a lot On Dec 11, 12:41 am, Polat Tuzla <[EMAIL PROTECTED]> wrote: > django-attachments application at > thehttp://github.com/korpios/django-chicago/tree/master > is a good example that has a model (Attachment) with a file field and > a form that is

Re: user_id in admin pages

2008-12-10 Thread Django Newbie
Found it thanks. http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-methods James Bennett wrote: > On Wed, Dec 10, 2008 at 6:28 PM, Django Newbie <[EMAIL PROTECTED]> wrote: > >> This is probably an easy one, but I've tried what make sense to me with >> not success. What

TemplateSyntaxError No module name utils

2008-12-10 Thread Milan Andric
I'm getting one of those bubbly exceptions coming through the template that are tricky to debug. TemplateSyntaxError at / Caught an exception while rendering: Could not import journalism_mm.workshops.views. Error was: No module named utils http://dpaste.com/97981/ I was reorganizing my code,

can't get new model to show up in admin

2008-12-10 Thread Norm Aleks
I'm using Django 1.0.2 (on Dreamhost, if that matters) and having trouble getting a new model to show up. I'm cringing a little because I know this has been a FAQ -- know that I *have* put some effort into Googling this problem, and I read up on the changes to the admin setup between 0.96 and

Re: Problem loading custom PostgreSQL function at syncdb time.

2008-12-10 Thread Malcolm Tredinnick
On Wed, 2008-12-10 at 16:01 -0500, Raymond Cote wrote: > Hi Everyone, > > I'm having problems loading a custom PostgreSQL trigger function during > syncdb and not sure how to address this: > The function (trimmed down) looks as follows: > > CREATE OR REPLACE FUNCTION probe_data_insert() >

Re: Using composition for building database models

2008-12-10 Thread Malcolm Tredinnick
On Wed, 2008-12-10 at 11:11 -0800, Mr. T wrote: > > On Dec 10, 11:04 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: [...] > > It sounds like you are looking for model inheritance: > > > > http://docs.djangoproject.com/en/dev/topics/db/models/#id4 > > > > Karen > > Stupid of me to write

Re: user_id in admin pages

2008-12-10 Thread James Bennett
On Wed, Dec 10, 2008 at 6:28 PM, Django Newbie <[EMAIL PROTECTED]> wrote: > This is probably an easy one, but I've tried what make sense to me with > not success. What I want to do is in my admin pages, use the User > module and enter the the user_id of whoever is logged in to add an entry > in

Re: forms.ModelChoiceField selected field

2008-12-10 Thread Malcolm Tredinnick
On Wed, 2008-12-10 at 16:00 +0100, Alfredo Alessandrini wrote: > Hi, > > I've this form: > > class PlayerForm(forms.Form): > challengeable = forms.BooleanField(required=False) > show_name = forms.BooleanField(required=False) > message_move = forms.BooleanField(required=False) >

Re: Access to Many-To-Many intermediary table from django

2008-12-10 Thread Malcolm Tredinnick
On Wed, 2008-12-10 at 06:22 -0800, nucles wrote: > Hello, > > If we create 2 models with many-to-many relationship django creates > the intermediary table automatically for us. > How can i use this intermediate table to relate other entities? What do you mean? Normally you don't need to worry

Re: cursor already closed

2008-12-10 Thread Malcolm Tredinnick
On Wed, 2008-12-10 at 13:32 +0100, Thomas Guettler wrote: > Hi, > > I get this error from psycopg2: "InterfaceError: cursor already closed" > > The error is repeatable, but not the way you would expect. > > The error happens at id 1142. If I use objects.filter.(id__gt=1140) > instead of all()

Re: Count is different when using custom SQL?

2008-12-10 Thread Malcolm Tredinnick
On Wed, 2008-12-10 at 02:11 -0800, Darthmahon wrote: [...] > Now what I've noticed is that the number of results (count) is > different between the results that have not been group and those that > have. Hopefully the code below makes some sense: > >

Re: Overrding queryset on a field in form generated with ModelForm

2008-12-10 Thread Malcolm Tredinnick
On Wed, 2008-12-10 at 00:18 -0800, Tony Chu wrote: > Hi All, > > I was using the ModelForm to generate my first form in Django. > ModelForm is great. However, I had wanted to dynamically limit the > selection of Foreign keys to a subset I generate. > > The only way I found after a lot of

Re: Problem loading custom PostgreSQL function at syncdb time.

2008-12-10 Thread DavidA
This sounds suspiciously similar to the problem I had with initial SQL scripts in MySQL. In my case I was inserting rows into a table and one of the string fields contained %. I had to "escape" the % (using %%). I'm guessing that the SQL isn't directly executed but somehow evaluated in the

user_id in admin pages

2008-12-10 Thread Django Newbie
This is probably an easy one, but I've tried what make sense to me with not success. What I want to do is in my admin pages, use the User module and enter the the user_id of whoever is logged in to add an entry in one of my foreign key tables. How can set a field equal to the user_id to be

Combining multiple Django applications.

2008-12-10 Thread davidc
Hi, I'm new to Django and am after some advice :) I have a variety of applications in my project, each with different data models, that exist at /app1 /app2 /app3 etc. Each of them contains a 'newsfeed' style index page with a series of entries and comments, but the format of the entries differs

Re: A custom field that populates other models

2008-12-10 Thread pielgrzym
Thanks for numerous corrections and help :) "doesn't work" was stupid indeed ;) sorry :) The problem with saving is that when I try to save a post instance I recieve: AttributeError: 'TagField' object has no attribute '_meta' (link to full error report: http://wklej.org/hash/098a9cbd7a/ ) I'm

Re: image uploading via admin, and an error...

2008-12-10 Thread garagefan
alright, managed to work my way around and get the jpeg uploading to work... expect i'm still getting that suspicious operation error On Dec 10, 4:49 pm, Brian Neal <[EMAIL PROTECTED]> wrote: > On Dec 10, 2:20 pm, garagefan <[EMAIL PROTECTED]> wrote: > > > getting this error: > > > "Upload a

Re: Development server crash with no error message

2008-12-10 Thread Graham Dumpleton
Forgot to ask, what platform? On Dec 11, 10:05 am, Andrew Fong <[EMAIL PROTECTED]> wrote: > I'm using MySQLdb, cmemcache, PIL, and the django.contrib.gis stuff. > > On Dec 8, 2:58 pm, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > On Dec 9, 8:50 am, Andrew Fong <[EMAIL PROTECTED]> wrote: >

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
> It isn't a bug. Read the docs. Create yourself an empty 404.html and > 500.html file in your templates directory and your flatpage will work > with DEBUG=False. You are so right!! :) It worked like a charm! I neglected this box: "Ensure that your 404 template works Note that the

Re: Excel Generating Report

2008-12-10 Thread garces.85
Hi, Problem solved, in my template i put the following: http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> And the following line before my the head tag: Now i get the result that i want, without any strange characters. Thanks! --~--~-~--~~~---~--~~ You

Re: Development server crash with no error message

2008-12-10 Thread Andrew Fong
I'm using MySQLdb, cmemcache, PIL, and the django.contrib.gis stuff. On Dec 8, 2:58 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Dec 9, 8:50 am, Andrew Fong <[EMAIL PROTECTED]> wrote: > > > When I'm poking around in my Django app, my development server > > (manage.py runserver) will

Installing two Django sites using FastCGI

2008-12-10 Thread James Matthews
I am running one django site on dreamhost and now i want to run another. When setting up my site i needed to set DJANGO_SETTINGS_MODULE to my current site. Now i want to run another site... How do i go about this. Thanks James -- http://www.astorandblack.com/

Re: Form stays invalid even after required field has been set

2008-12-10 Thread John M
I had this same issue, and it turned out i was not showing a necessary field. My advice, try to recreate from the command line with the basic form object and see what it says is missing. Good Luck, John On Dec 10, 7:26 am, Berco Beute <[EMAIL PROTECTED]> wrote: > Here's the code: > >

Re: Generate a simple news archive list?

2008-12-10 Thread David Lindquist
Perfect! I can't believe I overlooked that in the documentation. Thanks Brian On Dec 10, 2:15 pm, Brian Neal <[EMAIL PROTECTED]> wrote: > On Dec 10, 2:31 pm, David Lindquist <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > I am building a simple news app for my employer's website. I am using > >

Re: image uploading via admin, and an error...

2008-12-10 Thread Brian Neal
On Dec 10, 2:20 pm, garagefan <[EMAIL PROTECTED]> wrote: > getting this error: > > "Upload a valid image. The file you uploaded was either not an image > or a corrupted image." > > tried with a gif and with a jpg. I've got PIL installed..." You may not have the correct libraries installed for

Re: image uploading via admin, and an error...

2008-12-10 Thread garagefan
I attempted this with a png and was greeted with a success... but then python/server denying access to the directory due to "suspicious operation"... so i've got two things to fix... I suppose i need to set up some kind of write access to the server? On Dec 10, 3:20 pm, garagefan <[EMAIL

Re: Generate a simple news archive list?

2008-12-10 Thread Brian Neal
On Dec 10, 2:31 pm, David Lindquist <[EMAIL PROTECTED]> wrote: > Hello, > I am building a simple news app for my employer's website. I am using > Django's date-based generic views for the various pages. I want to > have a sidebar listing the archive by year and month like this: > > 2008 > > -

Re: get_profile() and save()

2008-12-10 Thread bruno desthuilliers
On 10 déc, 11:18, [EMAIL PROTECTED] wrote: > Hi, > > I've got a ManyToMany-Field in my user-get_profile model. Now I've got these > lines of code: > > 1. up = user.get_profile() > 2. up.groups.add(bla) > 3. up.groups.save() > 4. up.save() > > Is it necessary to call up.groups.save() (line 3)

Re: Form stays invalid even after required field has been set

2008-12-10 Thread Berco Beute
On Dec 10, 7:24 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > You say you excluded 'product' from the form but the code you posted has not > excluded 'product', it has excluded 'parent' and 'usePrice'. Ahem[hides under a rock in shame]...I guess copy/paste got me there. > Also, the

Problem loading custom PostgreSQL function at syncdb time.

2008-12-10 Thread Raymond Cote
Hi Everyone, I'm having problems loading a custom PostgreSQL trigger function during syncdb and not sure how to address this: The function (trimmed down) looks as follows: CREATE OR REPLACE FUNCTION probe_data_insert() RETURNS SETOF trigger AS $$ DECLARE ofs VARCHAR; BEGIN

Generate a simple news archive list?

2008-12-10 Thread David Lindquist
Hello, I am building a simple news app for my employer's website. I am using Django's date-based generic views for the various pages. I want to have a sidebar listing the archive by year and month like this: 2008 - November - December 2009 - January with each item linking to its view (year,

onetomany relationship with manytomany postgres table

2008-12-10 Thread adleslie
Hello, I am converting from PHP to Django. In my Postgres database I have three tables: models.py code: class Publication(models.Model): pubtitle = models.TextField() def __unicode__(self): return self.pubtitle class Pathology(models.Model): pathology =

Re: referencing the current instance inside limit_choices_to

2008-12-10 Thread bruno desthuilliers
On 10 déc, 19:25, fiedzia <[EMAIL PROTECTED]> wrote: > On Dec 10, 1:56 am, GuyBowden <[EMAIL PROTECTED]> wrote: > > > I'd like to set the limit_choices_to value of a ForeignKey field based > > on another selection in the current instance. > (snip) > > other thing to look at is that what is passed

Re: Index page using flatpages

2008-12-10 Thread Brian Neal
On Dec 10, 1:58 pm, Nuno Machado <[EMAIL PROTECTED]> wrote: > Hi Brian. Thank you. > > I've read the documents you pointed out. But the issue is not on > 404/500 html templates, but in the DEBUG setting. No, it isn't. > > I've started a project from scratch to reproduce my error. I used the >

image uploading via admin, and an error...

2008-12-10 Thread garagefan
getting this error: "Upload a valid image. The file you uploaded was either not an image or a corrupted image." tried with a gif and with a jpg. I've got PIL installed... it probably has to do with my models.vi. from django.db import models from django.core.files.storage import

Has anyone released a "User-Specific File Manager App?"

2008-12-10 Thread Keyton Weissinger
Hi There, I have a use case to build an online "file-locker" sort of app where each user can upload and download files (word processing documents, excel spreadsheets, etc) into a user-specific/secure location. Users would log into the site, and see the files on the server in their specific

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
Hi Brian. Thank you. I've read the documents you pointed out. But the issue is not on 404/500 html templates, but in the DEBUG setting. I've started a project from scratch to reproduce my error. I used the instructions provided in the latest documentation to add FlatPages and an Admin

Re: request parsing

2008-12-10 Thread Polat Tuzla
django-attachments application at the http://github.com/korpios/django-chicago/tree/master is a good example that has a model (Attachment) with a file field and a form that is driven by the model (AttachmentForm). For forms with other types of fields including an image field you can check out

Re: How to write to a FileField?

2008-12-10 Thread Mikkel Høgh
That worked, thanks :) On Dec 10, 7:51 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Dec 10, 10:47 am, Mikkel Høgh <[EMAIL PROTECTED]> wrote: > > > > > Ok, I've been looking all over the docs for a solution to this, but > > there's a lot of documentation for the FileField, just not on how to

How to hide/show an admin field when a radio field is selected

2008-12-10 Thread Fabio Natali
Dear all, say I have a model "boat" with a radio field which let me choose between "sailing boat" and "motor boat". ## class Boat(models.Model): name = models.CharField(max_length=30) TYPE = ( ('S', 'Sailing Boat'), ('M',

Re: Using composition for building database models

2008-12-10 Thread Mr. T
On Dec 10, 11:04 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Dec 10, 2008 at 1:51 PM, Mr. T <[EMAIL PROTECTED]> wrote: > > > As I am a noob this is very possibly a stupid question > > > Basically I would like to be able to use composition to build some of > > my models without

Re: Using composition for building database models

2008-12-10 Thread Karen Tracey
On Wed, Dec 10, 2008 at 1:51 PM, Mr. T <[EMAIL PROTECTED]> wrote: > > As I am a noob this is very possibly a stupid question > > Basically I would like to be able to use composition to build some of > my models without having separate tables being created. > > class baseClass: > field1 >

Using composition for building database models

2008-12-10 Thread Mr. T
As I am a noob this is very possibly a stupid question Basically I would like to be able to use composition to build some of my models without having separate tables being created. class baseClass: field1 class foo(models.Model): my_base = baseClass() class

Re: How to write to a FileField?

2008-12-10 Thread Rajesh Dhawan
On Dec 10, 10:47 am, Mikkel Høgh <[EMAIL PROTECTED]> wrote: > Ok, I've been looking all over the docs for a solution to this, but > there's a lot of documentation for the FileField, just not on how to > use it… > > I have a model that looks like this: > > class Import(models.Model): >

Fwd: Re: TransactionMiddleware and SessionMiddleware

2008-12-10 Thread Tim Sawyer
On Wednesday 10 December 2008 16:46:36 Thomas Guettler wrote: > Hi, > > I follow: http://docs.djangoproject.com/en/dev/topics/db/transactions/ > {{{ > The order is quite important. The transaction middleware applies not > only to view functions, but also for all middleware modules that come >

Re: referencing the current instance inside limit_choices_to

2008-12-10 Thread fiedzia
On Dec 10, 1:56 am, GuyBowden <[EMAIL PROTECTED]> wrote: > I'd like to set the limit_choices_to value of a ForeignKey field based > on another selection in the current instance. Perhaps someone will come with better idea, but for now to achieve this result i am modifying queryset in form

Re: Form stays invalid even after required field has been set

2008-12-10 Thread Karen Tracey
On Wed, Dec 10, 2008 at 10:26 AM, Berco Beute <[EMAIL PROTECTED]> wrote: > > Here's the code: > > http://dpaste.com/97758/ > > My modelform stays invalid although the required fields of the > instance are set. The 'product' field is excluded from the form > because it shouldn't be edited. When

Re: Form stays invalid even after required field has been set

2008-12-10 Thread Rajesh Dhawan
On Dec 10, 12:51 pm, Berco Beute <[EMAIL PROTECTED]> wrote: > Thanks. There are no non-field errors though. Outputting the incoming > request object shows the error: > > orderLineForm is invalid: Product:This field > is required. id="id_Tickety tick-product"> > > The 'product' is required it

Re: Form stays invalid even after required field has been set

2008-12-10 Thread Berco Beute
Thanks. There are no non-field errors though. Outputting the incoming request object shows the error: orderLineForm is invalid: Product:This field is required. The 'product' is required it says, but I just set it 2 lines before... 2B On Dec 10, 6:32 pm, Tim <[EMAIL PROTECTED]> wrote: > Try

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
Thanks a lot, Jeff FW and Dmitry Dzhus. I'm using the most recent release version of Django (installed 5 days ago). 'django.contrib.flatpages' and 'django.contrib.sites' are listed in my INSTALLED_APPS. 'middleware.FlatpageFallbackMiddleware' is in my MIDDLEWARE_CLASSES. My urls.py WAS

Re: Form stays invalid even after required field has been set

2008-12-10 Thread Tim
Try adding this to your template: {% if form.non_field_errors %} {{form.non_field_errors.as_ul}}{% endif %} This will tell you form errors that aren't specific to a field. Tim On Dec 10, 8:26 am, Berco Beute <[EMAIL PROTECTED]> wrote: > Here's the code: > > http://dpaste.com/97758/ > > My

A new menuing app

2008-12-10 Thread ognjen . maric
Having needed to write some kind of a menuing app for virtually all of my Django projects, and seeing that I couldn't really find any that would fit my needs, I finally sat down to try and write a distributable and generic one. And so, http://code.google.com/p/django-yama/ was born. Copy/paste

Re: Logic for stylesheets

2008-12-10 Thread Daniele Procida
On Wed, Dec 10, 2008, Dave Dash <[EMAIL PROTECTED]> wrote: >I'm curious at what you're trying to ultimately do. > >On one of the projects I work on, we put a class on a encapsulating >div that defines future behavior: > > > > > > >and then we can do a special style for > >.no_content .content

Re: Logic for stylesheets

2008-12-10 Thread Daniele Procida
On Wed, Dec 10, 2008, CLIFFORD ILKAY <[EMAIL PROTECTED]> wrote: >In your case, you could have something like the following on that >specific page template, or if you need it for the general case, in your >base page template. > >{% block base_css %} >{% if content %} >

Re: Logic for stylesheets

2008-12-10 Thread Dave Dash
I'm curious at what you're trying to ultimately do. On one of the projects I work on, we put a class on a encapsulating div that defines future behavior: and then we can do a special style for .no_content .content {display: none} or whatever we end up deciding to do differently. On Dec

Using Django authentication for phpBB

2008-12-10 Thread Giles Thomas
Hi all, I've written some glue code so that people who are logged in to the Django portions of our website [1] can post to our phpBB-based forums without having to log in again - basically a django-auth plugin for phpBB. I'm wrapping it up as a project on Google Code (MIT license) [2] so

TransactionMiddleware and SessionMiddleware

2008-12-10 Thread Thomas Guettler
Hi, I follow: http://docs.djangoproject.com/en/dev/topics/db/transactions/ {{{ The order is quite important. The transaction middleware applies not only to view functions, but also for all middleware modules that come after it. So if you use the session middleware after the transaction

Re: Logic for stylesheets

2008-12-10 Thread CLIFFORD ILKAY
Daniele Procida wrote: > In a template I have: > > {% placeholder right-column Textarea %} > > I'd like the template to load stylesheetb.css rather than > stylesheeta.css if that content item is empty. > > I guess I need some logic around the the styles listed in the , > but I don't know

Re: issue with django tagging

2008-12-10 Thread garagefan
http://code.google.com/p/django-tagging/issues/detail?id=110 On Dec 10, 9:19 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > thanks > after I imported tagging,the errors is following: > Traceback (most recent call last): >   File "", line 1, in >     import tagging >   File

Re: cpu load

2008-12-10 Thread Zagor
Thanks for your feedback and pointers. We managed do drop the CPU load with some more caching and changing our Apache config to have threads serve more requests before dying (not 100% convinced that this dropped the cpu load but it did eliminate some server errors generated by crawlers). We run

How to write to a FileField?

2008-12-10 Thread Mikkel Høgh
Ok, I've been looking all over the docs for a solution to this, but there's a lot of documentation for the FileField, just not on how to use it… I have a model that looks like this: class Import(models.Model): complete_data = models.FileField(upload_to='import_data/complete/ %Y/%m/')

Logic for stylesheets

2008-12-10 Thread Daniele Procida
In a template I have: {% placeholder right-column Textarea %} I'd like the template to load stylesheetb.css rather than stylesheeta.css if that content item is empty. I guess I need some logic around the the styles listed in the , but I don't know what it should be, so I'd be grateful for

Form stays invalid even after required field has been set

2008-12-10 Thread Berco Beute
Here's the code: http://dpaste.com/97758/ My modelform stays invalid although the required fields of the instance are set. The 'product' field is excluded from the form because it shouldn't be edited. When the form is posted I'm trying to set the product on the form instance again, but that

forms.ModelChoiceField selected field

2008-12-10 Thread Alfredo Alessandrini
Hi, I've this form: class PlayerForm(forms.Form): challengeable = forms.BooleanField(required=False) show_name = forms.BooleanField(required=False) message_move = forms.BooleanField(required=False) message_confirm = forms.BooleanField(required=False) country =

Can I prevent admin from listing related objects on delete confirmation page?

2008-12-10 Thread Jacob Rigby
I have a Survey object that relates to many Response objects (say from 100 - 1000) If I delete the Survey in the Admin page using the django development server, the delete confirmation page loads after a few minutes. I could almost live with that. But under lighttpd my connection just times out

Access to Many-To-Many intermediary table from django

2008-12-10 Thread nucles
Hello, If we create 2 models with many-to-many relationship django creates the intermediary table automatically for us. How can i use this intermediate table to relate other entities? Can i access to the primary field of the intermediary table? Should i create two One-to-Many relations manually

Re: Multithreading issu with GDAL transform

2008-12-10 Thread Tobias Kräntzer
Am Mittwoch, den 10.12.2008, 14:55 +0100 schrieb Justin Bronn: > No, it is not thread safe. This is because both the GEOS and GDAL > libraries are not thread safe. While those development teams are > working on making the libraries thread safe, they are not at this > time. Thus, do not use

Re: issue with django tagging

2008-12-10 Thread [EMAIL PROTECTED]
thanks after I imported tagging,the errors is following: Traceback (most recent call last): File "", line 1, in import tagging File "C:\Python25\Lib\site-packages\tagging\__init__.py", line 3, in from tagging.managers import ModelTaggedItemManager, TagDescriptor File

Re: issue with django tagging

2008-12-10 Thread [EMAIL PROTECTED]
Thank you very much. I'll try it at once.BTW:when will the 0.3 version release? :) On Dec 10, 12:14 am, garagefan <[EMAIL PROTECTED]> wrote: > I had the same issue... you need to do two things... > > copy this into the setup.py > > from django.conf import settings > settings.configure() > > and

Re: Index page using flatpages

2008-12-10 Thread Dmitry Dzhus
Nuno Machado wrote: > If I put / in the URL field, I need to write "mysite.com//" to get > access to my index page. This is not good for visitors! It works fine for me when URL of flatpage is just slash, I type in site.com and see my flatpage. Probably your Django installation is a bit old or

Re: Index page using flatpages

2008-12-10 Thread Jeff FW
Nuno, "Yes, I do. It's a default setting." Never hurts to check--just because it's default, doesn't mean you haven't unset it :-) I just ran a very simple test, using a project that I use for testing Django apps--which I had never used flatpages in. I added the FlatpageMiddleware, added

Re: Multithreading issu with GDAL transform

2008-12-10 Thread Justin Bronn
> in our views. It seems that this call ist not thread safe. Because it is > several weeks (or month) ago that we had this problem, I just wonted to > ask, if it is known. No, it is not thread safe. This is because both the GEOS and GDAL libraries are not thread safe. While those development

cursor already closed

2008-12-10 Thread Thomas Guettler
Hi, I get this error from psycopg2: "InterfaceError: cursor already closed" The error is repeatable, but not the way you would expect. The error happens at id 1142. If I use objects.filter.(id__gt=1140) instead of all() it does not happen. Has someone seen something like this before?

Re: referencing the current instance inside limit_choices_to

2008-12-10 Thread GuyBowden
Thankyou - saves me searching down this dead end... Cheers, Guy On Dec 10, 7:54 am, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > There is no way to have per-instance limit_choices_to. > > On Wed, Dec 10, 2008 at 03:56, GuyBowden <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I've looked about but

Re: custom distinct() method

2008-12-10 Thread jamesjacksonn...@gmail.com
Dear Russell, it's an honor to receive advices from a such a django guru as You are - thanks for devoting your time. > First off - patience. Only 10 hours passed between your original > request and your repeat. This is an international mailing list, we're > spread all over the globe, and we're

Re: custom variables in settings.py

2008-12-10 Thread Darthmahon
Actually just realised you want to do this in the template file. How about this: http://www.djangosnippets.org/snippets/67/ On Dec 10, 10:50 am, Darthmahon <[EMAIL PROTECTED]> wrote: > First thing you need to do is import your settings file at the top of > your .py file > > import

Re: custom variables in settings.py

2008-12-10 Thread Darthmahon
First thing you need to do is import your settings file at the top of your .py file import mysite.settings Then just reference it like so: {{ settings.MAP_MEDIA }} Cheers, Chris On Dec 10, 10:28 am, Leppy <[EMAIL PROTECTED]> wrote: > Hi everyone, > I am facing some issues in creating custom

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
Hi Jeff, Yes, I do. It's a default setting. I've been thinking about the 'django.contrib.flatpages' and the 'django.contrib.sites' modules and in some cases, they are worse than good. Maybe I'm facing one of those cases, so I should get ride of those modules and deploy an "extras" application

custom variables in settings.py

2008-12-10 Thread Leppy
Hi everyone, I am facing some issues in creating custom variables in settings.py and accessing that in a template. It is possible to access the default settings variable in template just by calling that variable like {{MEDIA_URL}}. I created a variable MAP_MEDIA as shown below: *settings.py*

get_profile() and save()

2008-12-10 Thread leonardo
Hi, I've got a ManyToMany-Field in my user-get_profile model. Now I've got these lines of code: 1. up = user.get_profile() 2. up.groups.add(bla) 3. up.groups.save() 4. up.save() Is it necessary to call up.groups.save() (line 3) and it is necessary to call up.save() (line 4) ? Afaik there is

Count is different when using custom SQL?

2008-12-10 Thread Darthmahon
Hi Guys, Ok got a bit of a tricky one here for some reason. Basically I am doing a query which returns a list of albums your friends own. The problem is that I need to group the results by the album id so that I only get a unique list of albums. Now what I've noticed is that the number of

A custom field that populates other models

2008-12-10 Thread pielgrzym
Hi there, I followed some examples in the documentation regarding contenttype and I wanted to write my own simple, generig tagging app. I know there is tagging application but it's troublesome when you try to pass tag names in GET (language specific chars). Here is my code - it doesn't work -

Referencing attributes of the kinds of administration / Export of data in CSV interface administration

2008-12-10 Thread Patricia P.
Hello everybody, i am new in Django and in the group, to see if i may help Trying export data to csv in the interface for administration, using : http://www.djangosnippets.org/snippets/790/ i met with the following error : Traceback: File

Multithreading issu with GDAL transform

2008-12-10 Thread Tobias Kräntzer
Hi, we are using django and the geodjango extension in some of our projects. While implementing a view in one of the last projects, I encountered a bug in the method 'transform' in 'django.contrib.gis.geos.Polygon'. We have a line like Polygon(p, srid=s).transorfm(4326) in our views. It

Overrding queryset on a field in form generated with ModelForm

2008-12-10 Thread Tony Chu
Hi All, I was using the ModelForm to generate my first form in Django. ModelForm is great. However, I had wanted to dynamically limit the selection of Foreign keys to a subset I generate. The only way I found after a lot of trial and error was the following: form['foreignkey'].field.queryset

Re: Using random.random() while running on server

2008-12-10 Thread bruno desthuilliers
On 9 déc, 23:56, Chris <[EMAIL PROTECTED]> wrote: > Thanks Daniel Roseman That did the trick. I did not think to do a > lambda > > > I _very_ strongly suggest you take some time learning Python. In this > > case, the parens are actually the call operator. Not applying this > > operator results