Re: Form Processing

2008-04-17 Thread Jeff Anderson
gvkreddy wrote: HI, This is vamsi . I am new to Django. Hello! How we can do form processing in django.? I need in startup screen to activate buttons depending on data stored in model. I'm not sure exactly what you mean by this. Can you be more specific? Django can output just

Re: Form Processing

2008-04-17 Thread rajiv bammi
Hi.. Please go through following link.. http://www.djangobook.com/en/1.0/chapter07/ feel free if u have any problem ;) Thanks Rajiv Bammi On Fri, Apr 18, 2008 at 11:07 AM, gvkreddy <[EMAIL PROTECTED]> wrote: > > HI, > > This is vamsi . I am new to Django. > > How we can do form processing

Form Processing

2008-04-17 Thread gvkreddy
HI, This is vamsi . I am new to Django. How we can do form processing in django.? I need in startup screen to activate buttons depending on data stored in model. How we can done this in django? Any help. Thanks in advance. by vamsi

Re: Prepopulate Slugfied from Foreign Key without using the id

2008-04-17 Thread Merrick
Thank you for that, I will have to study that because it is a lot cleaner than what I did. I added the following to my City model below Class Meta: def save(self): slug_parts = self.slug.split('-') num_slugs = len(slug_parts) state_position = (num_slugs - 1)

Re: Feel free to test queryset-refactor branch

2008-04-17 Thread Malcolm Tredinnick
On Thu, 2008-04-17 at 14:53 -0700, Justin Fagnani wrote: [...] > The first thing is that there seems to be no way to tell if an > instance of a parent class has a child instance without trying the > child reference and catching the DoesNotExist exception. For a class > with multiple subclasses,

Re: mail in base64

2008-04-17 Thread James Bennett
On Thu, Apr 17, 2008 at 10:16 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > (1) What version of Django are you using (the mail infrastructure has > changed a bit between 0.96 and trunk, from memory)? He was using Django 0.96, and running into this (fixed on trunk) issue:

Re: Why does one work but not the other

2008-04-17 Thread Malcolm Tredinnick
On Thu, 2008-04-17 at 12:44 -0700, phillc wrote: > I was using new forms for one of my forms, and i wanted to save a > relation. > i came upon an interesting problem along the way. is there a limit in > python on the number of chained function calls or something? Hmm ...there's a fair bit of

Re: mail in base64

2008-04-17 Thread Malcolm Tredinnick
On Thu, 2008-04-17 at 11:52 -0600, leonel wrote: > Hello > > I need to send mail and I'm using send_mail from django.core.mail > All works but the mail gets base64 encoded > > Am I missing some configuration so the send_mail sends the mail not encoded A few more details are needed here.

Re: Python lists

2008-04-17 Thread Malcolm Tredinnick
On Thu, 2008-04-17 at 09:13 -0700, jacoberg2 wrote: > Hey, > this is more of a python question than a django question. I don't want to sound rude, but this list has a high enough volume without also starting to double for http://groups.google.com/group/comp.lang.python/topics?hl=en It would

Re: How to display images in Admin change page?

2008-04-17 Thread Malcolm Tredinnick
On Thu, 2008-04-17 at 08:06 -0700, Legioneer wrote: [...] > I need to display > pictures on the latter page. According to documentation one can define > what to display there in the 'fields' attribute inside Admin inner > class. But in this attribute only model fields are allowed to be not >

Re: Django en Dreahost

2008-04-17 Thread Kenneth Gonsalves
On 18-Apr-08, at 5:01 AM, Juanjo Conti wrote: >>2. Download, Compile and install Python 2.5. DH default is 2.3 and >>2.4. > > Why this? Does not Django run with Python <= 2.3? afaik no -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/

Re: Prepopulate Slugfied from Foreign Key without using the id

2008-04-17 Thread James Punteney
The javascript is part of the Simple pages app I've been working on so you can view the code here: http://code.google.com/p/django-simplepages/source/browse/trunk/simplepages/templates/pages/auto_url_prepend.js It's a little different than what you are doing as I'm not pulling the display value

Re: ORM questions...I'm not smart

2008-04-17 Thread Richard Dahl
cjl, Essentially you need metatables that can describe the attributes relatable to your main models. I built a proof of concept db backend last year for a 'Database Application for the Management of Information related to all Things' , (codenamed: DAMIT) but decided that while possible,

Re: Response JSON Quoting

2008-04-17 Thread Darryl Ross
Szaijan wrote: Thanks Justin. Yes, I'm certain. And my previous install was also some variety of 0.96, though I downloaded that one manually. What was the complete SVN URL you used? You can get it with 'svn info' in the directory you checked out the Django code to. Regards Darryl

Re: Best practices sending out http requests from within django code

2008-04-17 Thread Russell Keith-Magee
On Fri, Apr 18, 2008 at 12:51 AM, Dan-Cristian Bogos <[EMAIL PROTECTED]> wrote: > Folks, > > I was wondering what is the best way to send out http requests from within > django. Shall I use an external library (like urllib) or use some django > internals? > Eg: I want to POST some info on some

Re: ORM questions...I'm not smart

2008-04-17 Thread ydjango
If Django ORM does not do what you want, use custom query, it is quite simple. http://www.djangoproject.com/documentation/model-api/#executing-custom-sql I just used it to do some aggregation functions(sum). Rest is pretty much python. use power of python. thanks Ashish Gupta On Apr 17, 1:22

Re: Django en Dreahost

2008-04-17 Thread Juanjo Conti
book4e escribió: > I've installed and run a django app on dreamhost without problem. I > recommend do the following things before install your django app. > >1. Install virtualenv to >create your own Python environment. >2. Download, Compile

Re: Feel free to test queryset-refactor branch

2008-04-17 Thread scott lewis
On 2008-04-17, at 1553, Justin Fagnani wrote: > Hey Malcolm, > > I've been using qs-rf for a while now with basically no problems. > Excellent work. > > There's one thing that may a little odd that I stumbled on while > trying to get some primitive polymorphism working: > > The first thing

Re: Enterprise applications with Django

2008-04-17 Thread ydjango
rather comparing with J2EE (which has made quite a few bad architecture choices on the way), better is to see what are your requirements and see if Python and django can do it with less effort and more elegance, while achieving desired maintainability, performance and scalability. and from

Generic views and user's objects

2008-04-17 Thread picky
Hi, I'm trying to use generic view in my app and I have some problems with objects related to the logged user. Here is a simplified version of my models : class Animal(models.Model): owner = models.ForeignKey(User) gender = models.CharField(max_length=1, choices=GENDERS) mother =

Re: session data or ???

2008-04-17 Thread Horst Gutmann
Well, you could minimize the amount of code you will have to repeat for each and every view function by doing some OOP. For instance you could probably do something like this in your views.py: class AbstractView(object): def __init__(self, request, *args, **kwargs): # Do some generic

Memory Usage on a VPS

2008-04-17 Thread Tim Sawyer
Hi Folks, I'm having trouble with Apache/Django memory usage on a Virtual Private Server. I only have 150Mb memory. I've turned KeepAlive off. I think I'm using prefork (how do I tell?) and it's set at the following: StartServers 2 MinSpareServers 1

Re: Feel free to test queryset-refactor branch

2008-04-17 Thread Justin Fagnani
Hey Malcolm, I've been using qs-rf for a while now with basically no problems. Excellent work. There's one thing that may a little odd that I stumbled on while trying to get some primitive polymorphism working: The first thing is that there seems to be no way to tell if an instance of a parent

Re: login with email

2008-04-17 Thread Chris
> Unless you imported Auth into the local namespace you need to call > auth.authenticate(). Thanks for the humor!! :) >>> from django.contrib.auth import authenticate, login >>> test = authenticate(username="testuser", password="testpass") >>> test If that were the case it would more than

Re: Prepopulate Slugfied from Foreign Key without using the id

2008-04-17 Thread Merrick
Hi James, thank you for responding, can you point me in the right direction with the javascript. --Merrick On Apr 17, 1:25 pm, "James Punteney" <[EMAIL PROTECTED]> wrote: > I ran into this issue the other day wanting to use a foreign key value to > prepopulate a slugfield and just getting

Re: login with email

2008-04-17 Thread jonknee
> I can't get a user object to return from authenticate. any > suggestions? > Unless you imported Auth into the local namespace you need to call auth.authenticate(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Virtual fields/columns [filtering ordering]

2008-04-17 Thread g00fy
In my project i need to have fields that are dynamic generated. By that i mean sth like SQL : "price*2 as price_2" but more complex. ( i need to have "price*ratio + left join ). So i need to add some code in to SQL that django generates, but i don't want to do whole SQL by myself. Currently i'm

Re: Prepopulate Slugfied from Foreign Key without using the id

2008-04-17 Thread James Punteney
I ran into this issue the other day wanting to use a foreign key value to prepopulate a slugfield and just getting the id (if anything). According to the documentation[1] prepopulate doesn't support foreign keys, so I ended up going the custom javascript route in order to get it working. --James

ORM questions...I'm not smart

2008-04-17 Thread cjl
DU: Don't ask me why, but I got the idea today to create a contact manager with Django, mostly as a learning exercise. Instead of doing it the 'easy' way, I had the dumb idea to make it 'dynamic'. What does that mean? I'm glad you asked. Here's how I see the database tables (I've omitted

Re: Prepopulate Slugfied from Foreign Key without using the id

2008-04-17 Thread Jeff Anderson
Merrick wrote: I setup the classes below in my model and would like to have access to the name of the state in the City model for use in the SlugField. As it is, I get the state id not the name of the state in the slugfield when I add a City through the admin. This is the correct behavior-- It

Re: How to organize views that combine multiple models

2008-04-17 Thread brooks
I'd put it in a separate, "global" views.py, outside both, like this: project/ profile/ employment/ urls.py views.py -- Brooks On Apr 16, 5:26 pm, meppum <[EMAIL PROTECTED]> wrote: > I have a Profile app and an Employment app under one project. I've > split these into two

Prepopulate Slugfied from Foreign Key without using the id

2008-04-17 Thread Merrick
I setup the classes below in my model and would like to have access to the name of the state in the City model for use in the SlugField. As it is, I get the state id not the name of the state in the slugfield when I add a City through the admin. I know the admin is aware of this value because the

Why does one work but not the other

2008-04-17 Thread phillc
I was using new forms for one of my forms, and i wanted to save a relation. i came upon an interesting problem along the way. is there a limit in python on the number of chained function calls or something? This did not work: class q_to_q_form(forms.Form): def __init__(self, columns,

login with email

2008-04-17 Thread Chris
hello, I am working on a website where our client wants to login through use of an email. I have the registration part figured out but when I go to login as shown here: http://dpaste.com/45576/ I can't get a user object to return from authenticate. any suggestions? thanks in advance!

Re: Strange tutorial behavior...

2008-04-17 Thread Jon
Answering my own question here :-) It looks like this is related to the proxy server settings in IE. Home machine didn't use a proxy server - no problem on IE7 (and probably not a problem on IE6 either). On work machine, there is a proxy server in the settings and localhost isn't automatically

Re: Migration from Linux to Windows Setup

2008-04-17 Thread oliver
Hi, you shouldn't really have to change any of your code just the settings.py file to reflect your new system layout. I am not sure about IIS and python, i am sure there will be a lot of hits when you google "python iis". Mysql should not be a problem either. Windows is less restrictive on

mail in base64

2008-04-17 Thread leonel
Hello I need to send mail and I'm using send_mail from django.core.mail All works but the mail gets base64 encoded Am I missing some configuration so the send_mail sends the mail not encoded Thank You Leonel --~--~-~--~~~---~--~~ You received this message

Re: Strange tutorial behavior...

2008-04-17 Thread Jon
Both cases I am using MySQL 5.0. However, new info: this ONLY appears in IE. When I use Firefox, this doesn't happen. I think this may be an IE 6.0 problem. I am using IE 6.0 on this machine, but at home, i was using IE 7.0. Still, this seems really weird. Also, when I switch from

Model View Releationship with basic newforms

2008-04-17 Thread [EMAIL PROTECTED]
Very new to Django and am trying to create an application with several form comprising a model class. I am using: from django import newforms as forms # and not the ModelForm The begining of my Policy model looks like: class Policy(models.Model): zip_code =

Re: Strange tutorial behavior...

2008-04-17 Thread Hernan Olivera
Maybe something about your database settings. You don't say what db are you using in each case. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Strange tutorial behavior...

2008-04-17 Thread Jon
Sure! On Apr 17, 12:00 pm, "Eric Liu" <[EMAIL PROTECTED]> wrote: > Hi, > May be you can post your source code,then we can check it whether there are > some wongs with it. > I simply cut and paste from the tutorial, but here 'tis: === polls/models.py:

Re: Protecting static files

2008-04-17 Thread andy baxter
Nate wrote: > Hi all, > I've been googling for days and haven't really found a good solution > to my problem. > > I am building a site where a user can view photos and then choose > which of the photos they want to purchase. (Weddings/parties/HS > graduation etc...) My client doesn't want other

Best practices sending out http requests from within django code

2008-04-17 Thread Dan-Cristian Bogos
Folks, I was wondering what is the best way to send out http requests from within django. Shall I use an external library (like urllib) or use some django internals? Eg: I want to POST some info on some other django site. Ta, DanB --~--~-~--~~~---~--~~ You

Python lists

2008-04-17 Thread jacoberg2
Hey, this is more of a python question than a django question. I have an XML parser set up to read some files and I want to create a list of dictionaries to pass to the method in the view. When i create the list, all the dictionary items end up being the same, instead of unique like they should

Re: Strange tutorial behavior...

2008-04-17 Thread Eric Liu
Hi, May be you can post your source code,then we can check it whether there are some wongs with it. 2008/4/17, Jon <[EMAIL PROTECTED]>: > > > I successfully ran the complete tutorial (using version 0.96.1) on my > home machine over last weekend without incident. > > This week, I tried to bring up

Re: Authentication django

2008-04-17 Thread Florencio Cano
Here http://www.djangoproject.com/documentation/authentication/ you can find information about authentication in Django. Hope this helps. 2008/4/17 Fernanda Boronat <[EMAIL PROTECTED]>: > > Hello, I am trying to develop a small application that allows > authentication, the idea is that I have

Strange tutorial behavior...

2008-04-17 Thread Jon
I successfully ran the complete tutorial (using version 0.96.1) on my home machine over last weekend without incident. This week, I tried to bring up my new application at work and started getting some strange errors in the admin tool. So I went back and redid the tutorial (to see if I was

Re: Multi DB question

2008-04-17 Thread Ivan Sagalaev
shabda wrote: >> You could use SQLAlchemy to access your forum database, as long as you >> don't need it in the admin. > > As, I just need to access the other DB in one place, I think this is > the way to go here. Come on guys! If you just need to create a record in a DB you certainly don't

Session is new every time

2008-04-17 Thread Martin Kaffanke
Hi there! When I try to login to the admin interface, django tells my my browser may not support cookies, or something Now I found out the cookie is stored correctly in the database and the cookie is correct in firefox (I can read that out with the web-developer toolbar) - I think the cookie is

Protecting static files

2008-04-17 Thread Nate
Hi all, I've been googling for days and haven't really found a good solution to my problem. I am building a site where a user can view photos and then choose which of the photos they want to purchase. (Weddings/parties/HS graduation etc...) My client doesn't want other users of the site to be

Re: 1 django Project / 2 designs

2008-04-17 Thread Michael
You could also just utilize your view code for the two so you don't need to change urls. def index(request): ... # code here that determines whether you want the winterview or summerview if summerview: return summerview(request) elif winterview: return winterview(request)

Authentication django

2008-04-17 Thread Fernanda Boronat
Hello, I am trying to develop a small application that allows authentication, the idea is that I have a table where I store several characteristics of users, I want to know how I can combine this table to table auth.user of django, and use authentication of django, perform any thing?

Re: How to display images in Admin change page?

2008-04-17 Thread Legioneer
Hi Malcolm, Am I right that list_display option affects display on the change list page (where one can select an object to change from the list) rather than on an individual object change page where propetries of the individual object are presented for edit? I need to display pictures on the

Re: Multi DB question

2008-04-17 Thread shabda
>You could use SQLAlchemy to access your forum database, as long as you >don't need it in the admin. As, I just need to access the other DB in one place, I think this is the way to go here. On Apr 17, 7:50 pm, "Ariel Mauricio Nunez Gomez" <[EMAIL PROTECTED]> wrote: > On Thu, Apr 17, 2008 at

Re: Multi DB question

2008-04-17 Thread Ariel Mauricio Nunez Gomez
On Thu, Apr 17, 2008 at 6:00 AM, shabda <[EMAIL PROTECTED]> wrote: > > I have a forum(non-Django) and a Django app both are in different > databases. Can you install django on the forum database? It would probably make your life a lot easier as you could write custom django models to use the

Re: Reverse relations, select_related, and the Queryset Refactor Branch

2008-04-17 Thread robotika
Awesome, thanks for the clarification Malcolm. It's certainly something I think would be useful, especially when it comes to geographically aware applications. I only wish I was smart enough to help contribute towards it :) I'm probably going to try having a GenericRelation model sit inbetween a

Re: How to display images in Admin change page?

2008-04-17 Thread Malcolm Tredinnick
On Thu, 2008-04-17 at 07:00 -0700, Legioneer wrote: > Hi All! > > Trying to get a solution for a problem. I have a model which has one > to many relationship with another model which contains an ImageField. > E.g: > > class Person(models.Model): > name = models.CharField(max_length=512) >

Re: Multi DB question

2008-04-17 Thread Daryl Spitzer
> Is there a recent merge of Django and MultiDB? Not that I know of. > Do I need to use MultiDB branch for this, or is there a simpler way? You could use SQLAlchemy to access your forum database, as long as you don't need it in the admin. See also this recent django-users thread:

How to display images in Admin change page?

2008-04-17 Thread Legioneer
Hi All! Trying to get a solution for a problem. I have a model which has one to many relationship with another model which contains an ImageField. E.g: class Person(models.Model): name = models.CharField(max_length=512) class Image(models.Model): image =

Re: Distributed databases

2008-04-17 Thread Wes Winham
Found it. http://softwaremaniacs.org/soft/mysql_cluster/en/ (found through Simon Willison's blog). It looks like my memory was wrong though, because it doesn't switch databases automatically depending on query type. It leaves it up to the view to decide which database to use. If you absolutely

Re: Distributed databases

2008-04-17 Thread Wes Winham
One of the blogs I follow posted up an example of an ORM tweak built for master/slave mysql setups. I'm having trouble finding it, but it's definitely possible to modify the ORM to make decisions about which database to use automatically so that you don't have to worry about it in your views or

Migration from Linux to Windows Setup

2008-04-17 Thread shocks
Hi I've been using Django for a while on a Linux setup. For this next job, Django will have to run on Windows Server 2003 with IIS 6 and MySQL. The question I have relates to migrating a project from Linux/ OS X to Windows. I don't have a local Windows box setup at the moment and I will

Very site for s/w review and free download.

2008-04-17 Thread GoodieMan
Very good site for Software review and free download http://freeware4.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django en Dreahost

2008-04-17 Thread book4e
I've installed and run a django app on dreamhost without problem. I recommend do the following things before install your django app. 1. Install virtualenv to create your own Python environment. 2. Download, Compile and install Python 2.5. DH

Start earning money online today

2008-04-17 Thread fan.jirka
Start earning money online today http://mimik-mik.blog.cz/0804/start-earning-money-online-today BUX.TO = THE BEST WAY TO EARN MONEY --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

ONLINE MILLIONARE JOB NETWORK GIVES THE OPPORTUNITY TO YOU EARN 2,00,000 DOLLARS IN A SINGLE WEEK. I ALSO GOT THE SAME AMOUNT LAST WEEK. JOIN WITH THEM HERE

2008-04-17 Thread niche
ONLINE MILLIONARE JOB NETWORK GIVES THE OPPORTUNITY TO YOU EARN 2,00,000 DOLLARS IN A SINGLE WEEK. I ALSO GOT THE SAME AMOUNT LAST WEEK. JOIN WITH THEM HERE www.onlinemillionare.blogspot.com IT IS A FREE USE PROGRAMME --~--~-~--~~~---~--~~ You received this

Multi DB question

2008-04-17 Thread shabda
I have a forum(non-Django) and a Django app both are in different databases. When a user is created in the Django I want to create another User in Forum. Do I need to use MultiDB branch for this, or is there a simpler way? Maybe using python-MysqlDB directly? Is there a recent merge of Django and

Re: 1 django Project / 2 designs

2008-04-17 Thread Massimiliano Ravelli
On 15 Apr, 10:41, martyn <[EMAIL PROTECTED]> wrote: > I want a default saison (that could be stored in my settings file). > It's not only a different design but it's also a different content > sometimes. > > Is this can be done with middleware ? session ? > I don't really know this aspect of

Re: New site - www.iau.org

2008-04-17 Thread Chris Hoeppner
This is really great! While I wouldn't like to speak in anybody's name, I think I can safely say that the comunity will benefit from this, and I'm really looking forward to the moment you opensource the code. ~ Chris El jue, 17-04-2008 a las 02:30 -0700, [EMAIL PROTECTED] escribió: > Hi Joe, >

Re: New site - www.iau.org

2008-04-17 Thread [EMAIL PROTECTED]
Hi Joe, On Apr 16, 11:28 am, "Joe Bloggs" <[EMAIL PROTECTED]> wrote: > A nice clean site, I would be interested to know:- Thanks > How long it took to develop? Approximately 5 man months (including all activities). Of these 5 months, only 1 1/2 month have been spent building the actual

Re: serving static content on Windows

2008-04-17 Thread apm
Indeed, the problem was the shortcut! Now, it just works fine. Thanks a lot, Koen André --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Using a custom storage

2008-04-17 Thread [EMAIL PROTECTED]
This requires ticket #5361 (http://code.djangoproject.com/ticket/5361) to do something like this you need to apply that patch(which should be pretty close to fine, I would try to track the ticket closely if you use that patch), then I would read the docs included in the patch. On Apr 17, 2:01

Using a custom storage

2008-04-17 Thread SammyRulez
Hi folks I'm trying to implement a custom Stroage via s3. Something like http://code.djangoproject.com/attachment/ticket/6390/S3_6390.20080321.py. I'm digging Django core code to find how to tell it to use the custom storage instead of the FileSystemStorage but without luck. Any suggestion on

ModelForm, Foreign key and blank value in choices

2008-04-17 Thread eXt
Hi all! I have a model defined like: class AnObject(models.Model): object_category = models.ForeignKey(ObjectCategory) and a ModelForm like: class AnObjectForm(ModelForm): class Meta: model=AnObject 'object_category' is represented by django.newforms.ModelChoiceField and is

Re: serving static content on Windows

2008-04-17 Thread koenb
The error message says it all: it is looking for testporject.polls.views.django.views.static. Notice the first part. It means your view function is taken from within testproject.polls.views (which is probably on top in your patterns declaration). You should take this declaration out of there and

Re: Something wrong with dividing

2008-04-17 Thread Poz
Thanks Alex! works great! On Apr 16, 10:29 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > When doing integer division, python returns the floor(it rounds the > answer), you need to cast one of the things being divided to a float > for it to return a float, pretty much remove all those int

Re: Have you used OrderingField?

2008-04-17 Thread Malcolm Tredinnick
On Thu, 2008-04-17 at 11:24 +1000, Malcolm Tredinnick wrote: > > On Wed, 2008-04-16 at 06:41 -0700, Julien wrote: > > Thanks Karen for the clarification! That code looked dead to me too... > > is that worth filing a ticket? > > It's not harmful and it could well be useful to some people who