unchecked checkboxes not accessed through request.POST['check_name']

2008-11-16 Thread limas
hello all I am doing a project in Django. I want to create a list by clicking upon a link, it will open up a new window using javascript window.open() method. I have two tables for list. class Saved_list(models.Model): description=models.CharField(max_length=100)

Re: avoid cascade delete

2008-11-16 Thread David Zhou
On Mon, Nov 17, 2008 at 2:34 AM, David Zhou <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2008 at 2:21 AM, Merrick <[EMAIL PROTECTED]> wrote: >> >> How do I avoid the default behavior that does a cascade delete. Of >> course I could use the cursor but would am hoping there is some option >> I

Re: avoid cascade delete

2008-11-16 Thread David Zhou
On Mon, Nov 17, 2008 at 2:21 AM, Merrick <[EMAIL PROTECTED]> wrote: > > I have two models, links and groups. A Link has an optional foreign > key Group. > > When I delete a Group, Django by default deletes all Links that > referenced the Group that is being deleted. > > How do I avoid the default

avoid cascade delete

2008-11-16 Thread Merrick
I have two models, links and groups. A Link has an optional foreign key Group. When I delete a Group, Django by default deletes all Links that referenced the Group that is being deleted. How do I avoid the default behavior that does a cascade delete. Of course I could use the cursor but would

Re: In forms, how add dynamic initial values out of reach for clients?

2008-11-16 Thread David Zhou
On Mon, Nov 17, 2008 at 1:24 AM, dexter <[EMAIL PROTECTED]> wrote: > > I want logged in users to be able to add comments but only want some > of the formfields displayed. Fields 'user', 'date' and 'discussion' > should be out of reach for my sitevisitors/clients. > ... > How should i solve this?

In forms, how add dynamic initial values out of reach for clients?

2008-11-16 Thread dexter
I want logged in users to be able to add comments but only want some of the formfields displayed. Fields 'user', 'date' and 'discussion' should be out of reach for my sitevisitors/clients. #models.py: class Comment(models.Model): user = models.ForeignKey(User) date =

Re: cascading drop down lists

2008-11-16 Thread David Zhou
On Sun, Nov 16, 2008 at 10:56 PM, adelevie <[EMAIL PROTECTED]> wrote: > I want to use a series of drop down lists to define this criteria. For > example, I want to first have to select the year. Then I hit submit > and the form is processed on the same page. Then the next drop down > list will

Re: Best way for making a "Poll"?

2008-11-16 Thread David Zhou
On Sun, Nov 16, 2008 at 11:20 PM, killsto <[EMAIL PROTECTED]> wrote: > How can I get choices, a CharField I guess, to show up as radio select > widgets in a form? You can manually retrieve form fields and display them however you want:

Re: Multithreaded Dev Server

2008-11-16 Thread [EMAIL PROTECTED]
Having two instances of the dev server running does seem like another easy way to do it, as it won't require installing anymore software. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: django monitoring page

2008-11-16 Thread Harish
thank you very much On Nov 14, 7:10 pm, Doug Van Horn <[EMAIL PROTECTED]> wrote: > Is the username/password prompt fromDjangoor Apache Auth? > > If it'sDjango, change the view to accept username/password params on > the query string (removing decorators and/or changing middleware to > allow

Best way for making a "Poll"?

2008-11-16 Thread killsto
First of all, I know the tutorial supplies somewhat of a poll, and I've been through it. What I want to do is make an app that has one poll (or question) of the day that someone can edit from the admin interface. Each question has 4 choices. Also, there will not be user registration, just a

Re: djangobook ch3, can't see the view current_datetime

2008-11-16 Thread Adam Yee
You were right, Django didn't see any URLs in the URLconf file because I wasn't using the right one. I had another site also called 'testproject' in a different directory (deleted now). So I was using views.py and settings.py in the /web/django directory, but the urls.py from a totally

cascading drop down lists

2008-11-16 Thread adelevie
Hi. I am creating a separate admin page than the built in one. This new admin site is meant to scrape data from my university's course catalog based on a given set of criteria. I want to use a series of drop down lists to define this criteria. For example, I want to first have to select the year.

Re: Django - Python 3

2008-11-16 Thread Malcolm Tredinnick
On Sun, 2008-11-16 at 19:10 -0700, Leonel Nunez wrote: > Hello: > > As we know python 3 is comming in December: > > http://www.python.org/download/releases/3.0/ > > Will there be many changes for django with python 3 Well, Django doesn't run out of the box on the Python 3 alphas, nor does

Re: djangobook ch3, can't see the view current_datetime

2008-11-16 Thread Malcolm Tredinnick
On Sun, 2008-11-16 at 17:41 -0800, Adam Yee wrote: [...] Good debugging info snipped. > When entering http://localhost:8080/testproject/time I'm reading this > in the Apache error log: > > [Sun Nov 16 17:27:37 2008] [info] mod_wsgi (pid=1768): Create > interpreter

Re: Django - Python 3

2008-11-16 Thread James Bennett
On Sun, Nov 16, 2008 at 8:10 PM, Leonel Nunez <[EMAIL PROTECTED]> wrote: > Will there be many changes for django with python 3 As this is a fairly common question, *please* consider searching the list archives for information. -- "Bureaucrat Conrad, you are technically correct -- the best

Django - Python 3

2008-11-16 Thread Leonel Nunez
Hello: As we know python 3 is comming in December: http://www.python.org/download/releases/3.0/ Will there be many changes for django with python 3 Thank You Leonel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Query spanning two foreign keys

2008-11-16 Thread Will McCutchen
On Nov 15, 7:55 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > This should do the job: > >         User.objects.filter(posts__parent__pk=1).distinct() That does the trick. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to

djangobook ch3, can't see the view current_datetime

2008-11-16 Thread Adam Yee
I'm a new user to Django, hi everyone. My system: Windows XP Python 2.5 Apache 2.2 >>configured for mod_wsgi MySQL, MySQLdb #Irrelevant at this point My issue: Having trouble getting the through the first example. Basically, when directing the browser to '.../time/' I'm still at the 'It

Re: How to deal with NTLM authentication

2008-11-16 Thread Lee Connell
Thomas, Thanks for reply, I will check it out, doesn't seem there is any documentation at least on the website, maybe there is some in the source. Is it possible to just add the appropriate headers to a response object? I would be interested in this working for basic authentication as well, that

Re: Caching and I18n

2008-11-16 Thread [EMAIL PROTECTED]
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 Server: WSGIServer/0.1 Python/2.5.2 Vary: Accept-Language, Cookie Content-Type: text/html;

Re: How to deal with NTLM authentication

2008-11-16 Thread Thomas Kerpe
Am 16.11.2008 21:51 Uhr, Lee Connell schrieb: > ... What I want to do is allow the user of my django app to login just > once, then if the user wishes to access the "embeded site" and > recieves the WWW-Authentication : NTLM response, I can just pass the > user and pass so the user is allowed

Re: populating database model with form model

2008-11-16 Thread jtobe
yes, i wanted all the new features and enhancements from 1.0 over 0.96, so i package my own django 1.0 version in the project. i have tried to use google's djangoforms as well as django.form and using either one, i get the same errors. i do appreciate all you trying to help me with this. i just

Re: populating database model with form model

2008-11-16 Thread Steve Holden
Beware, though, of assuming exact parallels. The django on GAE is a) somewhat out of date, and b) modified to adapt it to the Google App Engine hosting environment. Good luck with your project. regards Steve jtobe wrote: > thanks for trying to help. > > app engine models use .put() instead

Re: general problems with installing downloaded django apps

2008-11-16 Thread Steve Holden
webcomm wrote: [yet again at the top of the message, so I have yet again moved the response down to where it reads logically ...] > On Nov 16, 2:35 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> webcomm wrote: >> >> [Please don't top-post ... I've moved your answer down] >> >>> On Nov 16, 1:01

Re: populating database model with form model

2008-11-16 Thread jtobe
thanks for trying to help. app engine models use .put() instead of .save() and according to guido, there is very little difference between the two. I have pasted models.py and search.py so you can see the two. maybe that will help. paste url: http://dpaste.com/91258/ the django app i'm

Re: general problems with installing downloaded django apps

2008-11-16 Thread webcomm
Thanks Steve. That moves me forward. I'll read about module packages in my python book. I think what I'm discovering is that I've gotten somewhat deep into Django without really understanding some of the underlying python concepts. What is the point of setup.py files, if they are not really

Saving associated data with multiple formset_factory

2008-11-16 Thread Tane Piper
Hey there, The last Django application I worked on was in 0.96 and I'm trying to get used to the new stuff in there. I've been following the docs here: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#id2 trying to use the formset_factory on some forms. I have a Contact model,

Re: Caching and I18n

2008-11-16 Thread Ramiro Morales
On Sun, Nov 16, 2008 at 10:51 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello everyone, > > I'm trying to implement caching for my bilingual site. The problem is > that once I enable caching and I change the language (via the example > code in >

Re: populating database model with form model

2008-11-16 Thread Daniel Roseman
On Nov 16, 6:43 pm, jtobe <[EMAIL PROTECTED]> wrote: > Hi, i wasn't sure whether i should ask this here or on the google app > engine list. > > I really have two problems. The first is, if i have a form that i > populate choices in a choicefield using entries in the database, it > only updates

How to deal with NTLM authentication

2008-11-16 Thread Lee Connell
I have a website outside of django that uses NTLM authentication, requires username and pass to be entered before access to the site is allowed. I want to embed this site in a particular section within my django app which is not a problem. What I want to do is allow the user of my django app to

Re: Date Field question -

2008-11-16 Thread Lars Stavholm
Mahesh Vaidya wrote: > Hi, > I am going to used "DateField" in my model. Which format does date > field user is it DD/MM/ (European) or MM/DD/ (American) style > ? and is it customizable ? Have a look at... http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#date-format But

Re: general problems with installing downloaded django apps

2008-11-16 Thread Steve Holden
webcomm wrote: [Please don't top-post ... I've moved your answer down] > On Nov 16, 1:01 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> webcomm wrote: >>> Maybe I'm starting to get the idea... can apps be installed anywhere, >>> as long as they are on the python path? Are there any restrictions

Re: general problems with installing downloaded django apps

2008-11-16 Thread webcomm
Hmm. I've created several apps using the startapp command, but I don't see any references to those apps when I print sys.path. Does something happen behind the scenes when I use the startapp command that isn't visible when I print sys.path? If so, why not run the startapp command for all apps?

Re: Beginner desperately seeking Django experts.

2008-11-16 Thread bruno desthuilliers
On 15 nov, 07:54, Innergy <[EMAIL PROTECTED]> wrote: > Thanks for reading my question. I may not be asking all the right > questions. > > I am looking for a fast way to build a ecommerce site with many of the > qualities of threadless.com. I was told Django is an excellent > language Django

populating database model with form model

2008-11-16 Thread jtobe
Hi, i wasn't sure whether i should ask this here or on the google app engine list. I really have two problems. The first is, if i have a form that i populate choices in a choicefield using entries in the database, it only updates once. Every time after the first time it just uses the same vales

Re: general problems with installing downloaded django apps

2008-11-16 Thread Steve Holden
webcomm wrote: > Maybe I'm starting to get the idea... can apps be installed anywhere, > as long as they are on the python path? Are there any restrictions at > all with respect to where apps are installed? You've got it. There are no restriction (by Django) on where apps are installed, as long

Re: Using Admin From a Sub-Directory

2008-11-16 Thread Chris Spencer
Ah, thanks. Yeah, I included my baseurl in the admin prefix, and added /myapp/media/admin to my modwsgi config and now admin looks perfect. On Sun, Nov 16, 2008 at 12:18 PM, Jeff FW <[EMAIL PROTECTED]> wrote: > > You need a trailing slash after /myapp/media/admin. The final URL > will then come

Re: object_create generic view, how to deal with hidden field in my model?

2008-11-16 Thread Eric Veiras Galisson
On Sun, Nov 16, 2008 at 5:30 PM, Eric Veiras Galisson <[EMAIL PROTECTED]> wrote: > blablablabla I'm continuing tests to use obect_create generic view, and changed the way I call it, using a form class instead of a model class. So I have created a form which inherits from ModelForm and it

Re: ManyToManyField with multiple model options

2008-11-16 Thread Eric Veiras Galisson
Hi, On Sun, Nov 16, 2008 at 4:13 AM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > You can't do what you're trying to do in that fashion (using > ManyToManyField to an abstract base class). Many-to-many and foreign-key > relations are relations between one table to another table, not to

Re: general problems with installing downloaded django apps

2008-11-16 Thread webcomm
Maybe I'm starting to get the idea... can apps be installed anywhere, as long as they are on the python path? Are there any restrictions at all with respect to where apps are installed? -Ryan --~--~-~--~~~---~--~~ You received this message because you are

Re: Using Admin From a Sub-Directory

2008-11-16 Thread Jeff FW
You need a trailing slash after /myapp/media/admin. The final URL will then come out to: http://localhost/media/admin/css/dashboard.css -Jeff On Nov 16, 11:37 am, Chris <[EMAIL PROTECTED]> wrote: > I'm trying to setup my app so it's accessible from a /myapp sub- > directory. I defined BASEURL

Intercepting return from new ForeignKey popups? (RelatedObjectLookups.js)

2008-11-16 Thread Ben Gerdemann
I've been experimenting with an autocomplete widget for ForeignKey model fields following the very useful advice from Jannis here: http://jannisleidel.com/2008/11/autocomplete-form-widget-foreignkey-model-fields/ The basic idea is to create a widget with a hidden text field that contains the

object_create generic view, how to deal with hidden field in my model?

2008-11-16 Thread Eric Veiras Galisson
Hi django users, Currently writing an application in Django, I'm trying to use most of the super-powered tools that Django provide. One of them is generic views. Use of object_list and object_detail works well, even with more complex queries which I implement using a 'wrapper' view. But now

Model Formset Factory

2008-11-16 Thread Stu
When using a modelform on its own, I see that overriding __init__() enables the customization of generated forms. Is it possible to customize each of the modelforms (say changing the widgets on some of the form fields, adding/removing a field, etc.) in a modelformset when using

Using Admin From a Sub-Directory

2008-11-16 Thread Chris
I'm trying to setup my app so it's accessible from a /myapp sub- directory. I defined BASEURL = '/myapp' in settings.py, and created a context preprocessor so this variable is available to all templates. I then insert this variable at the beginning of all paths for js/css includes, links, etc.

Re: how can i get the object comments are attached to after post?

2008-11-16 Thread popufig
Thank you very much, Dave :) On 11月16日, 下午11时22分, DavidA <[EMAIL PROTECTED]> wrote: > From a quick scan of the source code, I don't think the object is > passed into the template, but you can get the related content object > directly from the comment (which is passed into the template). Just >

general problems with installing downloaded django apps

2008-11-16 Thread webcomm
I am fairly new to python and Django. I have no problem setting up my own apps by following the tutorial. However, I *always* have problems setting up someone else's apps. I think I've tried installing 5 apps that I've downloaded from code.google.com and elsewhere, and have been unsuccessful

Re: django unicode error

2008-11-16 Thread Karen Tracey
On Sun, Nov 16, 2008 at 10:18 AM, jamesM <[EMAIL PROTECTED]>wrote: > > there is a value 'Qué Onda Guero' in a mysql database. When i SELECT > this row from mysql, it's displayed correctly. When i connect to mysql > DB through python 2.6 shell using mySQLObject and assign the value to > a list,

Re: how can i get the object comments are attached to after post?

2008-11-16 Thread DavidA
>From a quick scan of the source code, I don't think the object is passed into the template, but you can get the related content object directly from the comment (which is passed into the template). Just use the content_object field of the comment like this: {{ comment.content_object.slug }}

django unicode error

2008-11-16 Thread jamesM
there is a value 'Qué Onda Guero' in a mysql database. When i SELECT this row from mysql, it's displayed correctly. When i connect to mysql DB through python 2.6 shell using mySQLObject and assign the value to a list, the >>list_name[0] gives 'Qu\xc3\xa9 Onda Guero', and >>variable =list_name[0]

Date Field question -

2008-11-16 Thread Mahesh Vaidya
Hi, I am going to used "DateField" in my model. Which format does date field user is it DD/MM/ (European) or MM/DD/ (American) style ? and is it customizable ? Thank You in advance -Mahesh --~--~-~--~~~---~--~~ You received this message because you are

Re: POP before SMTP authentication in Django while avoiding that the server mail goes to users' spam folder

2008-11-16 Thread Srdjan Popovic
Thanks for your reply. I have just tried to send one message through Python script and the other from Outlook to my GMX account and here are the headers: FROM PYTHON (CONSIDERED SPAM): Return-Path: <[EMAIL PROTECTED]> X-Flags: Delivered-To: GMX delivery to [EMAIL PROTECTED] Received:

Re: POP before SMTP authentication in Django while avoiding that the server mail goes to users' spam folder

2008-11-16 Thread Kenneth Gonsalves
On Sunday 16 November 2008 06:26:18 pm Srdjan Popovic wrote: > def send_mail(subject='', text='', sender='', to=''): >     M = poplib.POP3(settings.EMAIL_HOST) >     M.user(settings.EMAIL_HOST_USER) >     M.pass_(settings.EMAIL_HOST_PASSWORD) >     headers = "From: %s\r\nTo: %s\r\nSubject:

POP before SMTP authentication in Django while avoiding that the server mail goes to users' spam folder

2008-11-16 Thread Srdjan Popovic
I have recently started a new Django website, www.darela.com, and I have some problems with sending automatic mails. This is a community website, where consultants, contractors and other specialists can present themselves, publish their profiles and describe their skills and experience, publish

Re: Post/redirect/get pattern for file upload with confirmation

2008-11-16 Thread [EMAIL PROTECTED]
Accidentally posted the first reply and you already beat me to my actual reply, wow. The "not feeling right" part meant to imply that the disadvantages I could see for both made me wonder if there wasn't another (and better) option available, but based on your answer it seems that won't happen

[django1.0+comment framewok ]how can i get the object comments are attached to after post?

2008-11-16 Thread popufig
Hi everyone, i am now using Django’s comments framework, accoring to the book , after end user post the comment, we can create our own template comments/posted.html, and this template has a variable called object that refers to the object that received the comment. But i cannot get this

Caching and I18n

2008-11-16 Thread [EMAIL PROTECTED]
Hello everyone, I'm trying to implement caching for my bilingual site. The problem is that once I enable caching and I change the language (via the example code in http://docs.djangoproject.com/en/dev/topics/i18n/?from=olddocs#the-set-language-redirect-view ), the page does not change. The

Re: Post/redirect/get pattern for file upload with confirmation

2008-11-16 Thread [EMAIL PROTECTED]
Hi Malcolm, thanks for the fast reply. What is the downside of sticking this kind of information into a session, just that the session backend needs to carry this amount of information around and cookies have to be enabled for it to work? I otherwise would prefer it over (2) just for the cleaner

Re: Post/redirect/get pattern for file upload with confirmation

2008-11-16 Thread Malcolm Tredinnick
On Sun, 2008-11-16 at 04:39 -0800, [EMAIL PROTECTED] wrote: > Hi Malcolm, > thanks for the fast response. I had thought about both approaches, but > both didn't feel 100% right (more a gut feeling than anything). Then you're going to have provide more information about what would "feel right",

Re: Post/redirect/get pattern for file upload with confirmation

2008-11-16 Thread [EMAIL PROTECTED]
Hi Malcolm, thanks for the fast response. I had thought about both approaches, but both didn't feel 100% right (more a gut feeling than anything). On Nov 16, 1:16 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-11-16 at 12:58 +0100, Stefan Wallner wrote: > > p,,,[ > > > My

Re: Post/redirect/get pattern for file upload with confirmation

2008-11-16 Thread Malcolm Tredinnick
On Sun, 2008-11-16 at 12:58 +0100, Stefan Wallner wrote: p,,,[ > My basic idea would be to use the same URL and view/template for > getting the directory listing and posting a file for uploading to it. > If a file is uploaded successfully the renamed file name and the users > that received

Post/redirect/get pattern for file upload with confirmation

2008-11-16 Thread Stefan Wallner
Hi, I am confused on how to best use the post/redirect/get pattern for the following problem: Part of the application I am writing is a basic file manager, i.e. it lists directory contents to users and lets users download files or upload a file to the directory. Upon upload the file is

Re: How to create a form with dynamic number of fields?

2008-11-16 Thread Low Kian Seong
Thanks Ryan for the reply. Another idea that came to me is can we make an input like a list? as in wrote: > > I've recently had a situation where I needed to create dynamic forms > and corresponding code to handle them. > > One thing that you should know about python is that there's nothing

Re: How to create a form with dynamic number of fields?

2008-11-16 Thread Ryan Witt
I've recently had a situation where I needed to create dynamic forms and corresponding code to handle them. One thing that you should know about python is that there's nothing special about classes, you can take a collection of attributes and methods and use them to create a new class on-the-fly

Re: How to create a form with dynamic number of fields?

2008-11-16 Thread Ryan Witt
I've recently had a situation where I needed to create dynamic forms and corresponding code to handle them. One thing that you should know about python is that there's nothing special about classes, you can take a collection of attributes and methods and use them to create a new class on-the-fly