Re: Keeping fields out of the Admin

2008-11-20 Thread Lars Stavholm
Epinephrine wrote: > I have a field that should never be edited by hand. It is basically > date_letter_sent, and it should be filled in by a view function when > it sends a letter. > > How can I keep the field from being editable in the Admin edit page > for that class? editable = False in the

Re: Custom Select widget choices - how to reuse choices?

2008-11-20 Thread urukay
easy way how to solve it is to put definition of your choices out of model definition: CHOICES=((u'1','one'), (u'2',u'two')) class Movie( Relic ): disk_type = models.CharField( 'Type', max_length=8, choices=CHOICES) and then you can import CHOICES whereever you want and reuse it from ..mo

Re: ImportError: No module named psycopg2 on XP

2008-11-20 Thread Steve Holden
Steve Holden wrote: > dj wrote: > >> Hello All, >> >> I am trying to use PostgreSQL database and am I an stuck in the >> install of psycopg2. >> > [...] > > Hope this helps, though it may not ... > regards > Steve > PS: Binary installers available at http://www.stickpeople.com/projects

Re: ImportError: No module named psycopg2 on XP

2008-11-20 Thread Steve Holden
dj wrote: > Hello All, > > I am trying to use PostgreSQL database and am I an stuck in the > install of psycopg2. > I downloaded the psycopg2-2.0.8.tar and extracted the file to C: > \Python26\Lib\site-packages. > I opened a cmd box and typed python setup.py install. The build > completed without

Re: ImportError: No module named psycopg2 on XP

2008-11-20 Thread dj
Hello All, I am trying to use PostgreSQL database and am I an stuck in the install of psycopg2. I downloaded the psycopg2-2.0.8.tar and extracted the file to C: \Python26\Lib\site-packages. I opened a cmd box and typed python setup.py install. The build completed without errors, however, when I t

Re: indentation problem in file

2008-11-20 Thread waltbrad
On Nov 20, 6:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: >, so check very carefully (for example, > run tabnanny.py -- which is in the directory where Python is installed > -- over your code to check) > Thanks for that, Malcolm. I'll have to remember that tool. > > 1.1 pre-alpha > >

Eclipse/Mylyn for Django Dev

2008-11-20 Thread Keyton Weissinger
This is a question for my fellow Eclipse/PyDev fans Have any of you gone through the trouble to change your work flow to take advantage of Mylyn? >From the Mylyn web page (http://www.eclipse.org/mylyn/): "Mylyn is a task-focused interface for Eclipse that reduces information overload and mak

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread ayayalar
Thank you for the advise. I just started using Django and sometimes it takes time to get used to do certain things. Regards, Arif On Nov 20, 3:40 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-11-20 at 15:18 -0800, ayayalar wrote: > > I understand, I wish it was possible to b

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread Malcolm Tredinnick
On Thu, 2008-11-20 at 15:18 -0800, ayayalar wrote: > I understand, I wish it was possible to bind multiple view functions > to a single template through the urls... Why? It's the wrong level of coupling. Each URL patterns ends up resolving to a single view function. However that view function ca

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread ayayalar
As you can see I am trying to display a form that points to related models/tables. Any suggestion where I can find a good documentation or an article to accomplish this in "Django" way? I feel like I am not taking the right path On Nov 20, 3:23 pm, ayayalar <[EMAIL PROTECTED]> wrote: > I am able

access current model id, for custom widget

2008-11-20 Thread yves_s
hi everybody I'm making a custom form widget in the newforms admin and I want to have access to the id of the current model instance (for already existing data). Can I get the id from the request object? Or any other solution? I'm really going mad with this problem.. yves --~--~-~--~--

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread ayayalar
I am able to do this, but this is pure ugly. Not a very elegant way of doing things. def product(request): if not request.method == 'POST': form1 = ProductForm() form2 = ProductDetailForm() return render_to_response('index.html', {'form1' : form1, 'form2' : form2})

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread Brian Neal
On Nov 20, 4:50 pm, ayayalar <[EMAIL PROTECTED]> wrote: > And I do that. Here is my template: > No, you are not. Check the dictionary you are passing into your render_to_response() calls again. --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread ayayalar
I understand, I wish it was possible to bind multiple view functions to a single template through the urls... Would something like this possible? URLS urlpatterns = patterns('', (r'^product/$', views.add_product, views.add_product_details),) On Nov 20, 3:07 pm, Malcolm Tredinnick <[EMAIL

Re: indentation problem in file

2008-11-20 Thread waltbrad
On Nov 20, 6:07 pm, waltbrad <[EMAIL PROTECTED]> wrote: > On Nov 20, 5:45 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > > Is there something wrong with this.  I am using django 1.1 > > > Are you by any chance mixing spaces and tabs? The code *looks* OK. I > > doubt you are using 1.1, how

Re: indentation problem in file

2008-11-20 Thread Malcolm Tredinnick
On Thu, 2008-11-20 at 15:07 -0800, waltbrad wrote: [...] > Thanks for the response Steve. My code looks exactly as I posted it, > spaces and all. The error you posted also will have told you where the error was occurring, not just the error message. That would certainly be a good guide. It cert

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread Malcolm Tredinnick
On Thu, 2008-11-20 at 14:03 -0800, ayayalar wrote: [...] > URLS > urlpatterns = patterns('', > > (r'^product/$', views.add_product), > (r'^product/$', views.add_product_details), This has no chance of doing what you expect. Only one view function will be called for a single request. If

Re: indentation problem in file

2008-11-20 Thread waltbrad
On Nov 20, 5:45 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > Is there something wrong with this.  I am using django 1.1 > > Are you by any chance mixing spaces and tabs? The code *looks* OK. I > doubt you are using 1.1, however, since that hasn't been released yet. > > regards >  Steve Tha

Re: del session variables

2008-11-20 Thread Malcolm Tredinnick
On Thu, 2008-11-20 at 14:06 -0800, Bobby Roberts wrote: > is there a way to kill a session rather than running a del statement > on each session variable? I know in .asp you can simply say > session.abandon. Is there an equivalent with django? Django has this really nifty feature (I believe AS

Re: del session variables

2008-11-20 Thread Andy McKay
On 20 Nov 2008, at 22:06, Bobby Roberts wrote: > is there a way to kill a session rather than running a del statement > on each session variable? I know in .asp you can simply say > session.abandon. Is there an equivalent with django? In the session documentation there are mentions of: clear()

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread Karen Tracey
On Thu, Nov 20, 2008 at 5:03 PM, ayayalar <[EMAIL PROTECTED]> wrote: > > VIEW: > > def add_product(request): >if not request.method == 'POST': >form1 = ProductForm() >return render_to_response('index.html', {'form1' : form1}) >else: >form1 = ProductForm(request.POST

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread Andy McKay
Yes but you never pass two forms to the template at the same time. In add_product you pass form1, in add_product_details you pass form2. >>> (r'^product/$', views.add_product), >>> (r'^product/$', views.add_product_details), You have the same URL twice, only one of them will ever be ac

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread ayayalar
And I do that. Here is my template: {{ form1.as_table }} {{ form2.as_table }} On Nov 20, 2:15 pm, Brian Neal <[EMAIL PROTECTED]> wrote: > On Nov 20, 4:03 pm, ayayalar <[EMAIL PROTECTED]> wrote

Re: indentation problem in file

2008-11-20 Thread Steve Holden
waltbrad wrote: > Hate to bother with this, I'm sure it's a small thing. I'm going > through the 1st django app tutorial in the django documentation. I'm > doing okay until the Unicode statements they want inserted into the > models.py file, for the representation of objects in the interpreter.

Auto-notify outside/API services when instance Updated - Best Practices?

2008-11-20 Thread John.R
I'm working with an Event Model that, when saved (and possibly when updated) needs to run some custom Python code to notify some outside APIs - Twitter, Pownce, Google Calendar for instance. I know enough to implement Signals so that I don't have to code anything into the Event model itself if we

Help with GeoDjango and Google Maps, please...

2008-11-20 Thread ChrisK
I'm struggling to get django.contrib.gis.maps.google.gmap to do something interesting. I have looked at the embedded examples, and as far as they go, they're great. I would really like to display a polygon using GPolygon, and for the life of me can't figure out the right syntax to get the first ar

Re: Django development approach

2008-11-20 Thread John.R
On Nov 20, 3:54 pm, eldonp2 <[EMAIL PROTECTED]> wrote: > I've spent some time getting comfortable with Django. I would like to > try writing my first real app. I'd like to know whether I should go > ahead to write everything from scratch, or whether... > 1. Using pluggables can be easily integra

Re: Django development approach

2008-11-20 Thread Brian Neal
On Nov 20, 3:54 pm, eldonp2 <[EMAIL PROTECTED]> wrote: > I've spent some time getting comfortable with Django. I would like to > try writing my first real app. I'd like to know whether I should go > ahead to write everything from scratch, or whether... > 1. Using pluggables can be easily integrate

Re: Using Email for Username

2008-11-20 Thread Michael Newman
On Nov 20, 1:30 pm, Justin <[EMAIL PROTECTED]> wrote: > We want to use email addresses as our site's login username, not just > as an alternative authentication method. I figured a quick way to do > this would be just changing the auth user model's username field to an > EmailField instead of a

Re: Is it possible to display multiple forms in a single template file?

2008-11-20 Thread Brian Neal
On Nov 20, 4:03 pm, ayayalar <[EMAIL PROTECTED]> wrote: > VIEW: > > def add_product(request): >     if not request.method == 'POST': >         form1 = ProductForm() >         return render_to_response('index.html', {'form1' : form1}) >     else: >         form1 = ProductForm(request.POST) >      

indentation problem in file

2008-11-20 Thread waltbrad
Hate to bother with this, I'm sure it's a small thing. I'm going through the 1st django app tutorial in the django documentation. I'm doing okay until the Unicode statements they want inserted into the models.py file, for the representation of objects in the interpreter. On the website they sh

del session variables

2008-11-20 Thread Bobby Roberts
is there a way to kill a session rather than running a del statement on each session variable? I know in .asp you can simply say session.abandon. Is there an equivalent with django? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Is it possible to display multiple forms in a single template file?

2008-11-20 Thread ayayalar
VIEW: def add_product(request): if not request.method == 'POST': form1 = ProductForm() return render_to_response('index.html', {'form1' : form1}) else: form1 = ProductForm(request.POST) if form1.is_valid(): form1.save() return HttpRe

Django development approach

2008-11-20 Thread eldonp2
I've spent some time getting comfortable with Django. I would like to try writing my first real app. I'd like to know whether I should go ahead to write everything from scratch, or whether... 1. Using pluggables can be easily integrated into an existing app 2. Whether it will be easy to change the

Re: Caching an image in Django

2008-11-20 Thread bfrederi
My apologies, those tickets are exactly what I was looking for. Thanks! http://code.djangoproject.com/ticket/9180 http://code.djangoproject.com/ticket/5589 On Nov 20, 2:40 pm, bfrederi <[EMAIL PROTECTED]> wrote: > I don't think those ticket numbers are correct. Those are dealing with > forms...

Re: Is it possible to bind two forms to a single method?

2008-11-20 Thread Steve Holden
ayayalar wrote: > I have the following forms: > > from django.forms.models import ModelForm > from demo.home.models import Product, ProductDetail > > class ProductForm(ModelForm): > class Meta: > model = Product > > > class ProductDetailForm(ModelForm): > class Meta: > mode

Is it possible to bind two forms to a single method?

2008-11-20 Thread ayayalar
I have the following forms: from django.forms.models import ModelForm from demo.home.models import Product, ProductDetail class ProductForm(ModelForm): class Meta: model = Product class ProductDetailForm(ModelForm): class Meta: model = ProductDetail I am trying to han

Re: Caching an image in Django

2008-11-20 Thread bfrederi
I don't think those ticket numbers are correct. Those are dealing with forms... not caching. On Nov 20, 2:13 pm, "Ramiro Morales" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 20, 2008 at 6:00 PM, bfrederi <[EMAIL PROTECTED]> wrote: > > > I am trying to cache a small thumbnail image. The code is a bit

Re: Caching an image in Django

2008-11-20 Thread Ramiro Morales
On Thu, Nov 20, 2008 at 6:00 PM, bfrederi <[EMAIL PROTECTED]> wrote: > > I am trying to cache a small thumbnail image. The code is a bit > extensive, but the part this is breaking is that I am opening the > image file, then this: > > cache.set('thumbnail_file', image_file.read()) > > when I go to

Re: Keeping fields out of the Admin

2008-11-20 Thread James Bennett
On Thu, Nov 20, 2008 at 2:02 PM, Epinephrine <[EMAIL PROTECTED]> wrote: > How can I keep the field from being editable in the Admin edit page > for that class? I don't really mean to sound rude in saying this, but your best bet is probably to read through the documentation for the admin: http://

Keeping fields out of the Admin

2008-11-20 Thread Epinephrine
I have a field that should never be edited by hand. It is basically date_letter_sent, and it should be filled in by a view function when it sends a letter. How can I keep the field from being editable in the Admin edit page for that class? Thanks in advance! --~--~-~--~~--

Caching an image in Django

2008-11-20 Thread bfrederi
I am trying to cache a small thumbnail image. The code is a bit extensive, but the part this is breaking is that I am opening the image file, then this: cache.set('thumbnail_file', image_file.read()) when I go to retrieve the image with: cache.get('thumbnail_file') I get this traceback: Trace

Admin generic inlines don't handle multi-table inherited models

2008-11-20 Thread Mike Hurt
Hi all, Just wondering if anyone has come across the following problem, and if there is a way around it... I'm using both multi-table inheritance and generic relations to maintain a central repository of both general files, and display images in the following, simplified, way,: # # models.py #

Re: Filtered choices list for a m2m field from an m2m field within another model.

2008-11-20 Thread Silvano
Thanks for the answer Malcolm. Maybe I was unclear where I put the line "related_contacts = Contact.objects.filter(projects_involved__title__startswith=title)". Sorry for that. It was in the "Project" model, not in a view. When I validate the code as follows I get the described error no matter if

Re: NetBeans IDE for Python

2008-11-20 Thread ohmi
Same results here although other sorts of autocomplete to seem to be somewhat functional. No django-specific documentation yet, like how to set up the debugging environment. It looks like this stuff is being done according to their roadmap. Could be a great platform, esp. considering the price.

Re: Custom middleware only works when debugging is on

2008-11-20 Thread jwpeddle
Oh my god the stupidity. The error was in my 500.html template. NOTHING to do with my middleware. Sigh. On Nov 20, 1:54 pm, jwpeddle <[EMAIL PROTECTED]> wrote: > I've got a custom middleware class (nearly identical in function to > the flat page fallback middleware). When I have DEBUG = True, i

Re: Django install

2008-11-20 Thread waltbrad
On Nov 20, 1:22 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > On Windows systems, the same result can be achieved by copying the file > django-trunk/django/bin/django-admin.py to somewhere on your system > path, for example C:\Python24\Scripts. > > Hello Steve. Yes, I did that. Actually I j

Re: Django install

2008-11-20 Thread Steve Holden
waltbrad wrote: > > On Nov 20, 1:20 pm, Sahil R Cooner <[EMAIL PROTECTED]> wrote: > >> Have you tried checking out the django documentation, it's gotten a lot >> better than a year ago. >> >> You can find what you're looking for there >> at:http://docs.djangoproject.com/en/dev/topics/install/?

Re: Regional administrator

2008-11-20 Thread Carl Meyer
On Nov 20, 10:21 am, Huy Dinh <[EMAIL PROTECTED]> wrote: > Each user is allowed to make new posts and edit their own posts. They > are not allowed to create a post for a region that's not their own. The admin has hooks to allow you to do this sort of thing. This snippet[1] demonstrates the basic

Re: Importing standalone apps in a project

2008-11-20 Thread Carl Meyer
On Nov 20, 10:22 am, "Saurabh Agrawal" <[EMAIL PROTECTED]> wrote: > Using the Python IDLE, I am able to issue command "import coltrane" without > problem. (coltrane is the name of standalone app) > > However, I am not able to do so using Django configured shell "python > manage.py shell". It woul

Re: configuring production server for static media

2008-11-20 Thread Carl Meyer
Please stop the excessive top-posting; it makes reading the list digest painful. Quote only what you need to, and locate the quotes appropriately in your response. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: Django install

2008-11-20 Thread Steve Holden
waltbrad wrote: > Hi folks. I'm trying to install on my pc Django without success. I > was using instantdjango, but I'm told that there is some danger > because of it's internal webserver? > Anyway, I downloaded django and put the folder into C:\Python25\Lib > \site-packages. I also put the path

Using Email for Username

2008-11-20 Thread Justin
We want to use email addresses as our site's login username, not just as an alternative authentication method. I figured a quick way to do this would be just changing the auth user model's username field to an EmailField instead of a CharField (I know this isn't the most robust solution). Nonethel

Re: Django install

2008-11-20 Thread waltbrad
On Nov 20, 1:20 pm, Sahil R Cooner <[EMAIL PROTECTED]> wrote: > Have you tried checking out the django documentation, it's gotten a lot > better than a year ago. > > You can find what you're looking for there > at:http://docs.djangoproject.com/en/dev/topics/install/?from=olddocs > > Hello Sahil

Re: Django install

2008-11-20 Thread Sahil R Cooner
Have you tried checking out the django documentation, it's gotten a lot better than a year ago. You can find what you're looking for there at: http://docs.djangoproject.com/en/dev/topics/install/?from=olddocs On Thu, Nov 20, 2008 at 10:01:20AM -0800, waltbrad wrote: > > Hi folks. I'm trying t

Django install

2008-11-20 Thread waltbrad
Hi folks. I'm trying to install on my pc Django without success. I was using instantdjango, but I'm told that there is some danger because of it's internal webserver? Anyway, I downloaded django and put the folder into C:\Python25\Lib \site-packages. I also put the path to django-admin.py in my

Custom Select widget choices - how to reuse choices?

2008-11-20 Thread Donn
Hello, In my model, I define the choices for a charfield. I make a ModelForm of that model but I want my own widget for that field. How can I pass-through the choices I defined in my model? Some code: class Movie( Relic ): disk_type = models.CharField( 'Type', max_length=8, choices=((u'1','on

Re: Custom middleware only works when debugging is on

2008-11-20 Thread jwpeddle
Eliminated any possible issues in my urls conf. Even removing everything from it doesn't change the situation. On Nov 20, 1:54 pm, jwpeddle <[EMAIL PROTECTED]> wrote: > I've got a custom middleware class (nearly identical in function to > the flat page fallback middleware). When I have DEBUG = Tr

Re: Custom middleware only works when debugging is on

2008-11-20 Thread jwpeddle
Ok, I've tried to dumb things down, and it turns out the built-in flatpage fallback middleware ALSO doesn't have it's process_response called. I can only assume a response is sent before the middleware is reached, but I've got a pretty standard setup: MIDDLEWARE_CLASSES = ( 'django.middleware

Re: Help for crontab

2008-11-20 Thread Ben Eliott
recommend you check out django-extensions jobs. http://code.google.com/p/django-command-extensions/ On 20 Nov 2008, at 12:53, laspal wrote: > > hi, > I am writing cron job for my application but run into problem > > from django.core.management import setup_environ > import settings > setup_envi

Custom middleware only works when debugging is on

2008-11-20 Thread jwpeddle
I've got a custom middleware class (nearly identical in function to the flat page fallback middleware). When I have DEBUG = True, it works as expected. When I have DEBUG = False, I get errors stemming from variables set by the middleware not existing for the templates. After investigating, the onl

Re: Media and putting javascript last

2008-11-20 Thread Wes Winham
> Any reason this wouldn't work for you as well? The problem with that is that when I do {{ form.media.js }} (or whatever media output stuff I need to do) at the bottom, I'm going to have included jquery twice since jquery is a requirement in the Media class of any widgets/forms that need it. The

Re: Help with Abstract class and admin.py

2008-11-20 Thread Karen Tracey
On Thu, Nov 20, 2008 at 10:15 AM, JimR <[EMAIL PROTECTED]> wrote: > > Karen, > > Thanks for your help. Here's what I've done: > > I've commented out the list_display for GameAdmin and defined a > __unicode__ for game as: > >def __unicode__(self): >return '%s vs. %s' % (se

Re: Bug? Related manager not working for custom manager?

2008-11-20 Thread John M
Ian, Thanks for the reply, yes I've verified via the db.connections option that something is definitely wrong. John On Nov 19, 6:33 pm, "Ian Lewis" <[EMAIL PROTECTED]> wrote: > John, > > Try checking the log output of the database server to see what is > different about the SQL. Perhaps some ki

Regional administrator

2008-11-20 Thread Huy Dinh
Hi, I'm creating a website to allow 1 admin from each region to post news articles. Supposing the system has 3 users: 'eu', 'us' and 'asia' - one for each region. Each user is allowed to make new posts and edit their own posts. They are not allowed to create a post for a region that's not their

Re: Django template tag question

2008-11-20 Thread goblue0311
yeah, it was definitley the __init__.py issue, which I will strive to never forget again. Thanks! On Nov 19, 3:52 pm, Ben Eliott <[EMAIL PROTECTED]> wrote: > what happens when you go into the python interpreter and write > import basic > > On 19 Nov 2008, at 16:58, goblue0311 wrote: > > > > > I'

[Novice]Importing standalone apps in a project

2008-11-20 Thread Saurabh Agrawal
Hi, I am following Practial Django Projects book. In Chapter 4, Django Powered Weblog, James talks about standalone apps. The basic premise seems to be to include the app in the python path. I have done that. Using the Python IDLE, I am able to issue command "import coltrane" without problem. (c

Regional administrator

2008-11-20 Thread Huy Dinh
Hi, I'm creating a website to allow 1 admin from each region to post news articles. Supposing the system has 3 users: 'eu', 'us' and 'asia' - one for each region. Each user is allowed to make new posts and edit their own posts. They are not allowed to create a post for a region that's not their

Re: configuring production server for static media

2008-11-20 Thread Karen Tracey
On Thu, Nov 20, 2008 at 9:15 AM, Serdar T. <[EMAIL PROTECTED]> wrote: > > ok. so that fix workedkind of. > > I now get the properly formatted admin login page when I visit > http://mysite.org/admin/ > > But when I log in, the following 500 Internal Server Error appears: > "I'm sorry, that pag

Re: Creating formsets through AJAX

2008-11-20 Thread [EMAIL PROTECTED]
On 20 nov, 14:31, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 20 nov, 06:54, "Brian Rosner" <[EMAIL PROTECTED]> wrote: > > > > > On Wed, Nov 19, 2008 at 10:23 PM, [EMAIL PROTECTED] > > > <[EMAIL PROTECTED]> wrote: > > > > On 20 nov, 06:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote: > > >> O

Re: Help with Abstract class and admin.py

2008-11-20 Thread JimR
Karen, Thanks for your help. Here's what I've done: I've commented out the list_display for GameAdmin and defined a __unicode__ for game as: def __unicode__(self): return '%s vs. %s' % (self.team.name, self.opponent) That returns values in the admin display as "Team 1

Re: Bug? Related manager not working for custom manager?

2008-11-20 Thread John M
Malcom, Thank you so much for taking the time to look over this, and you're right, looking back, I should have trimmed down the problem for all to see. I've come up with a work-around for now, but will watch the ticket to see when it's fixed. I suspect it's something to do with the fact it's a

Re: Problems with file upload and model forms

2008-11-20 Thread Alex Koshelev
Do you use `enctype` attribute[1] of form tag? [1]: http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form On Thu, Nov 20, 2008 at 16:59, Marc Barranco <[EMAIL PROTECTED]> wrote: > > Hi! > I'm trying to upload a file like the example in documentation in > Django (h

Re: Using generic view to insert a simple model in the DB

2008-11-20 Thread John M
django writes about 90% of the form part for you. This was also an area for me (being new to HTML apps) that was confusing. You have two choices, you can use the {{form}} object in your html, or you can setup each field from the form individually. (http://docs.djangoproject.com/en/dev/ref/generi

Re: configuring production server for static media

2008-11-20 Thread Serdar T.
ok. so that fix workedkind of. I now get the properly formatted admin login page when I visit http://mysite.org/admin/ But when I log in, the following 500 Internal Server Error appears: "I'm sorry, that page is currently unavailable due to a server misconfiguration." That is actually a cu

Re: django site within 7 hours (a day)

2008-11-20 Thread Kenneth Gonsalves
On Thursday 20 November 2008 06:12:36 pm Masklinn wrote: > I don't think there's a problem on whether it's appropriate for the   > group, but there's already Django Pluggables (http://djangoplugables.com/ > ) as a "django applications hotspot" so the project is a bit redundant   > isn't it? but w

Problems with file upload and model forms

2008-11-20 Thread Marc Barranco
Hi! I'm trying to upload a file like the example in documentation in Django (http://docs.djangoproject.com/en/dev/topics/http/file- uploads/) with the "Forms from Models". But I can't upload the file because the form always return the error "this field is required" although selecting a file before

Re: serving static file via django

2008-11-20 Thread David Christiansen
Pranav, Have you considered just writing a view that returns the data in the file with the appropriate headers? That's very easy to do and doesn't require loading the whole static serve method. You can then also put whatever tracking you wanted in that view function. If you want, I can send you

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread dash86no
I had another go at this one (can never sleep on a problem) Fixed it: The problem was my lack of test data. If you only have one record in the table related to your foreign key, then the filter list will not show up at the side of the admin screen. If you add another record then the filter list

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread Ramiro Morales
On Thu, Nov 20, 2008 at 11:23 AM, dash86no <[EMAIL PROTECTED]> wrote: > > Having reread that documentation I can see it says "ForeignKey" as > plain as day. > > Sorry I'm an idiot. I'll work on this again tomorrow, time for sleep I > think > > > > On Nov 20, 10:19 pm, dash86no <[EMAIL PROTECTED]>

Re: Creating formsets through AJAX

2008-11-20 Thread [EMAIL PROTECTED]
On 20 nov, 06:54, "Brian Rosner" <[EMAIL PROTECTED]> wrote: > On Wed, Nov 19, 2008 at 10:23 PM, [EMAIL PROTECTED] > > > > <[EMAIL PROTECTED]> wrote: > > > On 20 nov, 06:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote: > >> On Wed, Nov 19, 2008 at 9:53 PM, [EMAIL PROTECTED] > > >> <[EMAIL PROTECTED]>

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread dash86no
Having reread that documentation I can see it says "ForeignKey" as plain as day. Sorry I'm an idiot. I'll work on this again tomorrow, time for sleep I think On Nov 20, 10:19 pm, dash86no <[EMAIL PROTECTED]> wrote: > Karen, > > Most people I know say "hey guys" to refer to mixed groups. I'm 27

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread dash86no
Karen, Most people I know say "hey guys" to refer to mixed groups. I'm 27 and mostly spending time with Americans nowadays so I don't know if that has anything to do with it. Anyway, I did try it, and I found whenever I tried to specify a foreign key it was simply ignored. I.e. no error message

Re: Help for crontab

2008-11-20 Thread Horst Gutmann
For things like that it's IMO still the best approach to write a custom command for the manage.py, which handles all this for you :-) http://docs.djangoproject.com/en/dev/howto/custom-management-commands/#howto-custom-management-commands -- Horst On Thu, Nov 20, 2008 at 1:53 PM, laspal <[EMAIL

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread Daniel Roseman
On Nov 20, 12:33 pm, "Dominic Ashton" <[EMAIL PROTECTED]> wrote: > Guys, > > A brief google search has led me to conclude that it's not possible to > filter on a foreign key field in the Admin. > > Can anyone explain the design rationale around that? Filtering by anything > but a foreign key value

Help for crontab

2008-11-20 Thread laspal
hi, I am writing cron job for my application but run into problem from django.core.management import setup_environ import settings setup_environ(settings) from test.crm.models import CronEmail Basically the problem is I am not able to import any model. I tried this too: pathname = os.path.dirn

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread Karen Tracey
On Thu, Nov 20, 2008 at 7:33 AM, Dominic Ashton <[EMAIL PROTECTED]>wrote: > Guys, > > A brief google search has led me to conclude that it's not possible to > filter on a foreign key field in the Admin. > Did you try it? I have foreign key fields specified in my filters and they work. What happ

Re: django site within 7 hours (a day)

2008-11-20 Thread [EMAIL PROTECTED]
> I don't think there's a problem on whether it's appropriate for the > group, but there's already Django Pluggables (http://djangoplugables.com/ > ) as a "django applications hotspot" so the project is a bit redundant > isn't it? Django pluggables is ok, but I can't get my applications listed on

Re: django site within 7 hours (a day)

2008-11-20 Thread Masklinn
On 20 Nov 2008, at 13:22 , tom wrote: > > Hi, > > don't know if this is the right place or not. Please let me know if > not. :) > > On the 18th of November in 2008 I was already working with django for > about one and a half year, writing several applications either for > customers or for myself

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread tom
Hi Dominic, do you may have a code sample? -tom On 20 Nov., 13:33, "Dominic Ashton" <[EMAIL PROTECTED]> wrote: > Guys, > > A brief google search has led me to conclude that it's not possible to > filter on a foreign key field in the Admin. > > Can anyone explain the design rationale around that

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread Dominic Ashton
Guys, A brief google search has led me to conclude that it's not possible to filter on a foreign key field in the Admin. Can anyone explain the design rationale around that? Filtering by anything but a foreign key value is usuless in many of my models. To give you a concrete example: I have a Pro

django site within 7 hours (a day)

2008-11-20 Thread tom
Hi, don't know if this is the right place or not. Please let me know if not. :) On the 18th of November in 2008 I was already working with django for about one and a half year, writing several applications either for customers or for myself. On this special day I thought it would be nice to demo

Re: NetBeans IDE for Python

2008-11-20 Thread lig
On 19 нояб, 21:22, Delta20 <[EMAIL PROTECTED]> wrote: > NetBeans for Python has been released and based on the NB Python > roadmap, it looks interesting for those of us working with Django. I > haven't had much of a chance to play with it yet since it just came > out today, but here's the info for

Re: Apache Segmentation Fault on succesful authentication

2008-11-20 Thread huw_at1
OK I'll give it a go when I get some time to try mod_wsgi. Thanks for all the help regarding this matter. On Nov 17, 10:30 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > Can you try building mod_wsgi instead and see if it picks up the > correct library? > > If it doesn't work, post the output

Using a HTML to fire off a data processing script on the server (REST or SOAP)

2008-11-20 Thread Shao
Dear ALL, I am very much interested in using a HTML to fire off a data processing script to run over the internet. I will be very grateful if you can advise me on passing parameters from an HTML form to a script and fire the script off to carry out full execution, monitor its progress and return

Re: Caching and I18n

2008-11-20 Thread Antoni Aloy
2008/11/20 Malcolm Tredinnick <[EMAIL PROTECTED]>: > > > Andrew's final comment on that ticket is accurate. Removing the code > duplication is pretty easy there and following the examples in > tests/regressiontests/middleware/tests.py to create some tests for it > should be fairly straightforward

Re: Caching and I18n

2008-11-20 Thread Malcolm Tredinnick
On Thu, 2008-11-20 at 07:17 -0200, Ramiro Morales wrote: > On Sun, Nov 16, 2008 at 10:14 PM, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > > > Hello Ramiro, > > > > thanks for your reply. According to the docs, the Locale and Session > > middlewares should set the Vary-On headers accordingly

Re: Caching and I18n

2008-11-20 Thread Ramiro Morales
On Sun, Nov 16, 2008 at 10:14 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello Ramiro, > > thanks for your reply. According to the docs, the Locale and Session > middlewares should set the Vary-On headers accordingly, and indeed > they are: > > Date: Sun, 16 Nov 2008 23:49:29 GMT > Serve

Re: serving static file via django

2008-11-20 Thread Steve Holden
Graham Dumpleton wrote: > > > On Nov 20, 1:41 pm, Steve Holden <[EMAIL PROTECTED]> wrote: [...] >> The drawbacks are that the Django web servers aren't designed to the >> same rigorous security standards that are applied to production web >> servers like Apache and lighthttpd, > > I really scra

Re: many to many matrix

2008-11-20 Thread Malcolm Tredinnick
On Thu, 2008-11-20 at 00:19 -0800, frans wrote: > Hi, I was wondering if there is some way to create a "matrix display" > for viewing/editing many to many relationships between objects ? > > I've been thinking to use django for network documentation. My idea is > to put all the networks we host

  1   2   >