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

2008-12-15 Thread Fabio Natali
Fabio Natali wrote: [...] > 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 = (

Re: SOAPpy and pyxml installation/usage

2008-12-15 Thread Steve
OK. I'm having second thoughts on suds. It seems to work great some times, but not so great on others. I have the following code, where vid is the wsdl of the video. Many of them fail. I got these wsdl's from http://www.xmethods.net and presumably they're good. def check(vid): try: clien

Re: problem with make-messages.py russian language

2008-12-15 Thread Dafidov
Hi Karen. Thank You for quick answer. Unfortunately after check and changing commend still not work :( Before I was using django 0.9.6 changeset 7496 and all worked fine. It's strange because when I'm using old command make-messages.py -l pl I have no errors... I was checking coding and in all l

Where to I need to install the Python database bindings?

2008-12-15 Thread Samir van de Sand
Hello everyone, I know this is am embarrassing question but I have to ask: Given that django is running on one machine and the database is running on another machine, where do I have install the python database bindings? I presume on the machine where django is running? regards Samir --~--~-

MarkSafe and widget rendering "/" disapeared

2008-12-15 Thread coulix
Hello Djangonauts, I have a custom widget to create a kind of group list which ommits the last "/" at the end of an input field. Making html validation to fail. The important code is here: rendered_cb = cb.render(name, option_value) print rendered_cb output.append(u'%s %s' % (

Re: Where to I need to install the Python database bindings?

2008-12-15 Thread Karen Tracey
On Mon, Dec 15, 2008 at 9:13 AM, Samir van de Sand wrote: > Hello everyone, > > I know this is am embarrassing question but I have to ask: Given that > django is running on one machine and the database is running on another > machine, where do I have install the python database bindings? I presum

Problem with field validation in 1.02

2008-12-15 Thread rtmie
H i , I am trying to migrate a project from 0.95 to 1.02 and so have to migrate all of my old model based validator stuff in the new forms style( my first encounter with the new forms style). I am having a problem with the following: in my model I have a AppUser class, with username , password ,

Problem with field validation in 1.02

2008-12-15 Thread rtmie
H i , I am trying to migrate a project from 0.95 to 1.02 and so have to migrate all of my old model based validator stuff in the new forms style( my first encounter with the new forms style). I am having a problem with the following: in my model I have a AppUser class, with username , password ,

Re: problem with make-messages.py russian language

2008-12-15 Thread Ramiro Morales
On Mon, Dec 15, 2008 at 12:15 PM, Dafidov wrote: > > Hi Karen. > Thank You for quick answer. > Unfortunately after check and changing commend still not work :( > Before I was using django 0.9.6 changeset 7496 and all worked fine. > It's strange because when I'm using old command > make-messages.p

Django Forms Date Format

2008-12-15 Thread Aldo
I am using django forms. I have created a model/form with 2 fields, name and date. Prior to saving the form i check if the form is_valid? if form.is_valid(): form.save() My problem is it wants the date in the format - MM/DD/ Otherwise it will not see the form as valid - and not save. H

Re: Django Forms Date Format

2008-12-15 Thread Aldo
Let me add, that my model contains this mydate = models.DateTimeField().input_formats = ('%Y.%m.%d %H:%M:%S',) But when i use the input_formats arg it allows my field to accept any numeric data eg: 2342342/42354235 is now accepted. On Dec 15, 2:57 pm, Aldo wrote: > I am using django forms. I h

Re: Django Forms Date Format

2008-12-15 Thread Lars Stavholm
Aldo wrote: > I am using django forms. I have created a model/form with 2 fields, > name and date. > > Prior to saving the form i check if the form is_valid? > > if form.is_valid(): > form.save() > > My problem is it wants the date in the format - MM/DD/ > Otherwise it will not see the

db API where ...or...

2008-12-15 Thread Lars Stavholm
Hi all, when combining Django ORM criteria you get the "...WHERE...AND..." clauses. How do I get the "...WHERE...OR..." clauses? Resorting to raw SQL? Kinda' lost, any input appreciated /Lars --~--~-~--~~~---~--~~ You received this message because you are subs

Re: db API where ...or...

2008-12-15 Thread Alex Koshelev
http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects On Mon, Dec 15, 2008 at 18:35, Lars Stavholm wrote: > > Hi all, > > when combining Django ORM criteria you get > the "...WHERE...AND..." clauses. > > How do I get the "...WHERE...OR..." clauses? > > Resorting

Re: Django Forms Date Format

2008-12-15 Thread Aldo
Yes I have tried that but still nothing - thats what lead me to looking at this! On Dec 15, 3:28 pm, Lars Stavholm wrote: > Aldo wrote: > > I am using django forms. I have created a model/form with 2 fields, > > name and date. > > > Prior to saving the form i check if the form is_valid? > > > if

Re: db API where ...or...

2008-12-15 Thread Tim Chase
> when combining Django ORM criteria you get > the "...WHERE...AND..." clauses. > > How do I get the "...WHERE...OR..." clauses? > > Resorting to raw SQL? Use Q objects and OR them together: http://www.djangoproject.com/documentation/models/or_lookups/ Foo.objects.filter( Q(field1='baz')

Re: Django Forms Date Format

2008-12-15 Thread Lars Stavholm
Aldo wrote: > Yes I have tried that but still nothing - thats what lead me to > looking at this! Try with "USE_I18N = False" in settings.py. Some sort of known issue, I do believe there's a ticket somewhere confirming this. /L > On Dec 15, 3:28 pm, Lars Stavholm wrote: >> Aldo wrote: >>> I am u

Re: db API where ...or...

2008-12-15 Thread Lars Stavholm
Alex Koshelev wrote: > http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects That's the one I'm looking for. Thanks! /L > On Mon, Dec 15, 2008 at 18:35, Lars Stavholm > wrote: > > > Hi all, > > when combining Django ORM crite

Re: db API where ...or...

2008-12-15 Thread Lars Stavholm
Thanks Tim, works like a charm. /L Tim Chase wrote: >> when combining Django ORM criteria you get >> the "...WHERE...AND..." clauses. >> >> How do I get the "...WHERE...OR..." clauses? >> >> Resorting to raw SQL? > > > Use Q objects and OR them together: > > http://www.djangoproject.com/docume

Re: setting the proper file permisions chmod

2008-12-15 Thread garagefan
Just wondering if anyone else has experience with setting the write permissions for apache using mod_python w/ django. On Dec 11, 6:01 pm, Graham Dumpleton wrote: > On Dec 12, 9:07 am,garagefan wrote: > > > which would actually result in keeping my server more secure... i > > would assume leavin

Re: Django Forms Date Format

2008-12-15 Thread Aldo
Still no good lars. Thanks though. On Dec 15, 3:44 pm, Lars Stavholm wrote: > Aldo wrote: > > Yes I have tried that but still nothing - thats what lead me to > > looking at this! > > Try with "USE_I18N = False" in settings.py. > Some sort of known issue, I do believe there's > a ticket somewhere

MarkSafe and widget rendering "/" disapeared

2008-12-15 Thread coulix
Hello Djangonauts, I have a custom widget to create a kind of group list which ommits the last "/" at the end of an input field. Making html validation to fail. The important code is here: rendered_cb = cb.render(name, option_value) print rendered_cb output.append(u'%s %s' % (

Model field order

2008-12-15 Thread bfrederi
If I've defined a model like so: class comment(models.Model): name = models.CharField(max_length=25) place = models.CharField(max_length=100, blank=True) comment = models.TextField() How do I get the order I defined the model fields in, once I have the model object. For instance: m

Re: setting the proper file permisions chmod

2008-12-15 Thread Brian Neal
On Dec 15, 9:51 am, garagefan wrote: > Just wondering if anyone else has experience with setting the write > permissions for apache using mod_python w/ django. > Instead of 0777 I use 0775. I chgrp on the uploads directory, making the group be a group that includes the apache user. --~--~---

Re: Django newbie observation

2008-12-15 Thread Robin Jakobsson
I agree on the Shipping site. Let's start a project? Cheers, Robin On 13 Nov, 17:45, "thi.l...@gmail.com" wrote: > > You will find lots of excellent examples of Django projects [...] > > It is sometimes difficult to know what Django version each project was > based on (especially those from dja

Re: setting the proper file permisions chmod

2008-12-15 Thread garagefan
how would i make the group include apache? On Dec 15, 11:32 am, Brian Neal wrote: > On Dec 15, 9:51 am, garagefan wrote: > > > Just wondering if anyone else has experience with setting the write > > permissions for apache using mod_python w/ django. > > Instead of 0777 I use 0775. I chgrp on th

Re: SOAPpy and pyxml installation/usage

2008-12-15 Thread Matias
Try checking the specific exception and its message. Matias. 2008/12/15 Steve > > OK. I'm having second thoughts on suds. It seems to work great some > times, but not so great on others. I have the following code, where > vid is the wsdl of the video. > Many of them fail. I got these wsdl's fro

Re: Model field order

2008-12-15 Thread bfrederi
Nevermind, I think I found my answer. in the model._meta attribute, there is an attribute called fields (model._meta.fields) that is a list of the fields in the model, in the order in which you defined them. On Dec 15, 10:24 am, bfrederi wrote: > If I've defined a model like so: > > class comme

Re: RHEL 5.2 + mysql + Django 1.0 => Django 0.95.4

2008-12-15 Thread Rachel Willmer
Thanks for the reply. Unfortunately the egg gives me the same problems as when I attempt an install from the tarball. Any RHEL users out there encountered this problem and fixed it? Rachel --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: login problem

2008-12-15 Thread Matias
Hello, You should check by which method was called your view. something like if request.method == "POST": #now you can use request.POST else: #just show the template Hope that helps, Matias. On Mon, Dec 15, 2008 at 5:15 AM, vierda wrote: > > Dear Ronny/all, > > Thank you for your re

Re: login django using curl

2008-12-15 Thread Brett Parker
On 14 Dec 12:07, Malcolm Tredinnick wrote: > > > On Sat, 2008-12-13 at 14:44 -0800, Adrián Ribao wrote: > > Hello, I'm writing a script and I'd like to login into a django webapp > > using pycurl or urllib. > > I've problems with the cookies, and every time the message is: "The > > session has e

Re: setting the proper file permisions chmod

2008-12-15 Thread Brian Neal
On Dec 15, 10:53 am, garagefan wrote: > how would i make the group include apache? > Not sure what you are asking. I look in /etc/group to see what groups apache belongs to. On my system, apache belongs to a group called apache. So I did something like: # chgrp apache uploads # chmod 775 uploads

Django + mail server

2008-12-15 Thread prem1er
Hey everyone, I'm trying to create a registration page on my website using Django forms. I just realized that I needed to install a mail server in order to send confirmation messages to my users through the forms. What type of setup is everyone using for this? i.e. Postfix + mutt. Thanks in a

Re: Multiple apps extending admin/change_list.html

2008-12-15 Thread Jeff Kowalczyk
On Dec 13, 9:31 pm, Malcolm Tredinnick wrote: > That sounds like the only way. If you want to see batchadmin's changes, > you have to extend from that. Thank you, I have made batchadmin find its media in my development setup. My change_list.html, which now extends batchadmin/change_list.html, i

Re: Django Forms Date Format

2008-12-15 Thread Karen Tracey
On Mon, Dec 15, 2008 at 10:55 AM, Aldo wrote: > > Still no good lars. Thanks though. > http://docs.djangoproject.com/en/dev/ref/forms/fields/#datefield documents how to override the default valid date formats for input to a DateField. http://docs.djangoproject.com/en/dev/topics/forms/modelform

Re: setting the proper file permisions chmod

2008-12-15 Thread garagefan
fantastic that worked amazingly well. thank you On Dec 15, 12:23 pm, Brian Neal wrote: > On Dec 15, 10:53 am, garagefan wrote:> how would i > make the group include apache? > > Not sure what you are asking. I look in /etc/group to see what groups > apache belongs to. On my system, apache belon

Re: Generating a slug from an m2m field

2008-12-15 Thread Delta20
In case anyone else is looking for a solution to this, here's the work- around I came up with: In the ModelAdmin class for Ticket, override the save_model function and force the m2m relations to be saved. For example: class TicketAdmin(admin.ModelAdmin): model = Ticket def save_model(s

Re: Django + mail server

2008-12-15 Thread Karen Tracey
On Mon, Dec 15, 2008 at 1:01 PM, prem1er wrote: > > Hey everyone, > I'm trying to create a registration page on my website using Django > forms. I just realized that I needed to install a mail server in > order to send confirmation messages to my users through the forms. > What type of setup i

Re: Where to I need to install the Python database bindings?

2008-12-15 Thread Samir van de Sand
Thank you for the answer Karen. One other question: Does the db admin need to set any permissiona so that Django can connect via oracle_cx to the database? (until now I always used to connect over ODBC to the db) On Mon, Dec 15, 2008 at 3:33 PM, Karen Tracey wrote: > On Mon, Dec 15, 2008 at 9:13

Re: Where to I need to install the Python database bindings?

2008-12-15 Thread Karen Tracey
On Mon, Dec 15, 2008 at 1:38 PM, Samir van de Sand wrote: > Thank you for the answer Karen. > One other question: Does the db admin need to set any permissiona so that > Django can connect via oracle_cx to the database? (until now I always used > to connect over ODBC to the db) > I wouldn't thin

Re: PREPEND_WWW

2008-12-15 Thread jmat
Just curious, has anyone else ever set this to true and not had it work? On Dec 14, 4:05 pm, jmat wrote: > I set this to true in my settings file but It doesn't seem to be > getting picked up. > > Does this still have issues with some middleware or am I seeing some > kind of settings reload or c

Re: Django + mail server

2008-12-15 Thread prem1er
Didn't know about this. Where do I set the EMAIL_HOST parameter? On Dec 15, 1:35 pm, "Karen Tracey" wrote: > On Mon, Dec 15, 2008 at 1:01 PM, prem1er wrote: > > > Hey everyone, > >   I'm trying to create a registration page on my website using Django > > forms.  I just realized that I needed to

Postgres Full-text search -- is it possible?

2008-12-15 Thread Info Cascade
Hi -- I'm wanting to improve searches by using full-text searching. The documentation says: > > > search¶ > > > A boolean full-text search, taking advantage of full-text indexing. > This is like contains but is si

Re: PREPEND_WWW

2008-12-15 Thread Ross
@jmat I have never tried Django's PREPEND_WWW, but it can easily be handled by Apache. Some of the features involving URLs, paths, etc. are possibly better left to Apache. Apache has a rewrite guide that has all the information you should need. I found a good link a while ago with exactly what yo

Re: Django + mail server

2008-12-15 Thread Oliver Beattie
http://docs.djangoproject.com/en/dev/ref/settings/#email-host On Dec 15, 7:25 pm, prem1er wrote: > Didn't know about this. Where do I set the EMAIL_HOST parameter? > > On Dec 15, 1:35 pm, "Karen Tracey" wrote: > > > > > On Mon, Dec 15, 2008 at 1:01 PM, prem1er wrote: > > > > Hey everyone, > >

Re: Postgres Full-text search -- is it possible?

2008-12-15 Thread alex.gay...@gmail.com
It can be done using extra as shown here: http://barryp.org/blog/entries/postgresql-full-text-search-django/ there isn't a way built into django to do it however, there are also a few external search projects to create a nicer search api in django. This one: http://code.google.com/p/djangosearch

ModelAdmin list_filter presets: usability best practice?

2008-12-15 Thread Jeff Kowalczyk
Does anyone have a best-practice suggestion for ModelAdmins which are best used with a preset list_filter? Put another way, where are the best usability customization points so the user sees a specific list filter when entering that modeladmin, and when being redirected after various actions, but

Re: PREPEND_WWW

2008-12-15 Thread jmat
Ok, thanks, I was curious if we use a .htaccess file to do the re- writing with django, does the file live in the webroot or in the django application root? On Dec 15, 12:41 pm, Ross wrote: > @jmat I have never tried Django's PREPEND_WWW, but it can easily be > handled by Apache. Some of the fea

Re: PREPEND_WWW

2008-12-15 Thread Craig Kimerer
Which version of Django are you using? Do you also have APPEND_SLASH set to true? There was a ticket about this a while back that was fixed ( http://code.djangoproject.com/ticket/9199). Hope that helps. Craig On Mon, Dec 15, 2008 at 11:23 AM, jmat wrote: > > Just curious, has anyone else eve

Beginners questions on forms containing multiple related model types.

2008-12-15 Thread Brian
Hi, I'm new to django and have been working hard to find "the right way" or at least "a good way" to do things. I'm running into a few problems though that I can't get answers for. The following post describes my situation very clearly. It may be long-winded but hopefully it's unambiguous. I'

logout_then_login - how to alter login_url

2008-12-15 Thread redbaron
quote from official docs about logout_then_login view: "login_url: The URL of the login page to redirect to. This will default to settings.LOGIN_URL if not supplied" How to supply alternative login_url? I add logout url to urls.py: url(r'^accounts/logout/ $','django.contrib.auth.views.logout_the

HTTPS and URL form field validation

2008-12-15 Thread Nick
Hello, My Django 1.0 project is installed on two different servers (one is development, the other staging, both running Red Hat Linux). The main page has a form with a URL field, and I'm using the built in Django field validation, which determines whether the URL is valid by seeing if it's reacha

Re: PREPEND_WWW

2008-12-15 Thread jmat
I'm using 1.0 Is the patch post 1.0 ? I was having a tough time figuring out if that patch was post 1.0 or not on the ticket (I'm probably blind ;) APPEND_SLASH is not modified (so it is default True) I changed PREPEND_WWW to True but it did not seem to have any effect... I can try the patch

Re: PREPEND_WWW

2008-12-15 Thread Craig Kimerer
Yes, this was fixed post 1.0 release. If you upgrade to 1.0.2 it may fix your problem. Craig On Mon, Dec 15, 2008 at 4:04 PM, jmat wrote: > > I'm using 1.0 > > Is the patch post 1.0 ? I was having a tough time figuring out if > that patch was post 1.0 or not on the ticket (I'm probably blind

Re: RHEL 5.2 + mysql + Django 1.0 => Django 0.95.4

2008-12-15 Thread Malcolm Tredinnick
On Mon, 2008-12-15 at 11:40 +, Rachel Willmer wrote: > Thanks for the reply. > > Unfortunately the egg gives me the same problems as when I attempt an > install from the tarball. > > Any RHEL users out there encountered this problem and fixed it? Whilst I use similar vintage RHEL boxes wit

Re: MarkSafe and widget rendering "/" disapeared

2008-12-15 Thread Malcolm Tredinnick
On Mon, 2008-12-15 at 06:22 -0800, coulix wrote: > Hello Djangonauts, > I have a custom widget to create a kind of group list which ommits the > last "/" at the end of an input field. > Making html validation to fail. > > The important code is here: > >rendered_cb = cb.render(name, option_v

Re: Django newbie observation

2008-12-15 Thread Ariel Mauricio Nunez Gomez
I think pinax basic_site is pretty much what you want/need for a sample_website. I would be +1 for a link to Pinax project at the end of the tutorials. Ayayalar: pinax-0.5.0.tar.gz Once the download is complete, uncompress it and you should be

Re: Multiple apps extending admin/change_list.html

2008-12-15 Thread Malcolm Tredinnick
On Mon, 2008-12-15 at 10:01 -0800, Jeff Kowalczyk wrote: > On Dec 13, 9:31 pm, Malcolm Tredinnick > wrote: > > That sounds like the only way. If you want to see batchadmin's changes, > > you have to extend from that. > > Thank you, I have made batchadmin find its media in my development > setup

Re: logout_then_login - how to alter login_url

2008-12-15 Thread Malcolm Tredinnick
On Mon, 2008-12-15 at 14:37 -0800, redbaron wrote: > quote from official docs about logout_then_login view: "login_url: The > URL of the login page to redirect to. This will default to > settings.LOGIN_URL if not supplied" > How to supply alternative login_url? If you look at the function signat

Accessing Multiple Databases

2008-12-15 Thread Tom Eastman
Hey Guys, I'm about to start developing a web front-end for a large database being developed by a colleague. The web front-end is only going to be accessing a sub-set of the database, and mostly via 'views' that will be specific to the requirements of the web frontend. I want to use Django,

Accessing Multiple Databases.

2008-12-15 Thread Tom Eastman
Hey Guys, I'm about to start developing a web front-end for a large database being developed by a colleague. The web front-end is only going to be accessing a sub-set of the database, and mostly via 'views' that will be specific to the requirements of the web frontend. I want to use Django,

Re: Sort Table Headers after data has been rendered via a POST request

2008-12-15 Thread SnappyDjangoUser
I wanted to run this by the group one more time does anyone know how to handle sorting results by table header URL after a POST request? I have used the SortHeaders class for GET requests and it works great. I am hoping to find a way to extend this for POST requests. Thanks! On Nov 25, 2:2

Re: login problem

2008-12-15 Thread vierda
Hi Matias, Thanks for your reply but I did'nt get your point. sorry I'm newbie and still learning. I modified my_view function in my views as your suggestion (if I didn't wrong get your point) as per below: def my_view(request): if request.method == "POST" : username = request.POST['use

Re: Accessing Multiple Databases.

2008-12-15 Thread Malcolm Tredinnick
On Tue, 2008-12-16 at 15:25 +1300, Tom Eastman wrote: > Hey Guys, > > I'm about to start developing a web front-end for a large database being > developed by a colleague. The web front-end is only going to be > accessing a sub-set of the database, and mostly via 'views' that will be > specif

Re: Accessing Multiple Databases.

2008-12-15 Thread Malcolm Tredinnick
On Tue, 2008-12-16 at 14:28 +1100, Malcolm Tredinnick wrote: > > On Tue, 2008-12-16 at 15:25 +1300, Tom Eastman wrote: > > Hey Guys, > > > > I'm about to start developing a web front-end for a large database being > > developed by a colleague. The web front-end is only going to be > > access

Re: problem in loading images.

2008-12-15 Thread Sura
Thank u so much for making me to take the right path... Actually i got a mistake in the urls.py where i missed to remove a '/'... Also i have one more doubt. Now the entire site url is under the control of django project urls.py.. But how can i install other applications like joomla where i need t

List a model fields

2008-12-15 Thread JF Simon
Hello, i'm new with python (and french so my english may seem very poor, sorry about that). I would like to list a model's fields and return a dict, here is the example : I have a model class with : meta_title : CharField(...) meta_description : CharField(...) body_header_title : CharField(...)

Re: logout_then_login - how to alter login_url

2008-12-15 Thread redbaron
> However, if you want to pass some extra information to the > logout_then_login function, look at the third argument in the url() call > -- the dictionary of extra parameters. You can set up the login_url > parameter there. hardcoding login_url is not the way I prefer to go. I supposed there is

Re: List a model fields

2008-12-15 Thread Daniel Roseman
On Dec 16, 6:53 am, JF Simon wrote: > Hello, i'm new with python (and french so my english may seem very > poor, sorry about that). > I would like to list a model's fields and return a dict, here is the > example : > > I have a model class with : > > meta_title : CharField(...) > meta_description