How to install django on Apache/Linux

2007-08-19 Thread shabda
I have apache installed on linux with mod_php, mysql. I am trying to get django working here, and am following the intsallation steps at http://www.djangobook.com/en/beta/chapter21/ . Step 1. Install mod_python did yum install mod_python. Checked that mod_python is installed. Step 2. Add this to

Re: How to install django on Apache/Linux

2007-08-19 Thread James Bennett
On 8/19/07, shabda <[EMAIL PROTECTED]> wrote: > I am *very* confused here, I have only installed mod_python, and > nothing specific to django. SO how would the line > PythonHandler django.core.handlers.modpython work? If you have Django installed on the server and on the Python path, it will

Re: Ajax Form Submission Trouble

2007-08-19 Thread Thejaswi Puthraya
> I'm using mochikit Try, onclick="$('button_id').disabled=true;" It is 'disabled' and not 'disable'. Check out button properties at http://www.w3schools.com/htmldom/dom_obj_button.asp According the W3Schools...disabled works since IE5.0...so I see no reason why it shouldn't work in IE7.0

Re: UnicodeEncodeError in template rendering

2007-08-19 Thread cesco
Thanks for your replies. Just to avoid any doubt, I'm using __unicode__ instead of __str__ and I'm using the latest development version of django (post unicode merge). > What is most important to know is (a) what is the data that it is > trying to render (both type and content). It's trying to

Re: UnicodeEncodeError in template rendering

2007-08-19 Thread Malcolm Tredinnick
On Sun, 2007-08-19 at 00:27 -0700, cesco wrote: > Thanks for your replies. > > Just to avoid any doubt, I'm using __unicode__ instead of __str__ and > I'm using the latest development version of django (post unicode > merge). > > > What is most important to know is (a) what is the data that it

How to install mysql-python

2007-08-19 Thread shabda
I am trying to setup django with mysql, After installing django and mysql I am trying to set up mysql-python. So I give the command $ easy_install MySQL-python And am getting a ton of errors. On the page http://www.djangobook.com/en/beta/chapter02/, under comments for mysql it says, "Don't forget

Re: Ajax Form Submission Trouble

2007-08-19 Thread Sasha Weberov
On Aug 19, 1:29 am, Thejaswi Puthraya <[EMAIL PROTECTED]> wrote: > > I'm using mochikit > > Try, > > onclick="$('button_id').disabled=true;" > > It is 'disabled' and not 'disable'. > Check out button properties > athttp://www.w3schools.com/htmldom/dom_obj_button.asp > According the

Re: Ajax Form Submission Trouble

2007-08-19 Thread Thejaswi Puthraya
> Thanks a bunch, but would that go into the markup or into the > comments.js file? I'm a js newb (really bad one). I'm guessing into > the js file, the submit button doesn't have an id. Here is my current > comments.js filehttp://dpaste.com/17243/ It would go into your template and not into

Re: How to install mysql-python

2007-08-19 Thread Thejaswi Puthraya
On Aug 19, 12:52 pm, shabda <[EMAIL PROTECTED]> wrote: > I am trying to setup django with mysql, After installing django and > mysql I am trying to set up mysql-python. > So I give the command > $ easy_install MySQL-python > And am getting a ton of errors. > On the

Re: UnicodeEncodeError in template rendering

2007-08-19 Thread cesco
Thanks a lot Malcolm, I think we are getting there:-) > So, have a look at the debug screen and click on the "local variables" > link just below this last line in the extended traceback. What is "s" > here (in particular, it would be good know what type(s) is)? Also, what > is the value of

Re: How to install mysql-python

2007-08-19 Thread Thejaswi Puthraya
On Aug 19, 1:16 pm, shabda <[EMAIL PROTECTED]> wrote: > But even that is not helping. I am on a centOS box, with python > 2.3.4. Since you are on CentOS and yum works...use yum to install python- devel,mysql-devel,zlib-devel,openssl-devel and then try compiling MySQL-python...I believe it

live bookmark equivalent in IE

2007-08-19 Thread novice
Hi guys, we created some RSS feeds from our website using the django syndication framework and things are working fine from firefox! And we want the same functionality to be available in other browsers, specially Internet explorer. We checked several addons for IE but still couldnt find anything

Re: How to install mysql-python

2007-08-19 Thread shabda
Trying the solution given at http://mail.python.org/pipermail/pythonmac-sig/2003-February/007223.html But even that is not helping. I am on a centOS box, with python 2.3.4. Tried the following things, 1. Added to setup.py thread_safe_library = NO (NameError: name 'NO' is not defined) removed

Re: How to install mysql-python

2007-08-19 Thread shabda
Yes the problem was with python-devel. After installing all the depndebcies, it went through fine. On Aug 19, 1:20 pm, Thejaswi Puthraya <[EMAIL PROTECTED]> wrote: > On Aug 19, 1:16 pm, shabda <[EMAIL PROTECTED]> wrote: > > > But even that is not helping. I am on a centOS box, with python > >

Re: UnicodeEncodeError in template rendering

2007-08-19 Thread Malcolm Tredinnick
On Sun, 2007-08-19 at 08:19 +, cesco wrote: > Thanks a lot Malcolm, I think we are getting there:-) > > > So, have a look at the debug screen and click on the "local variables" > > link just below this last line in the extended traceback. What is "s" > > here (in particular, it would be good

TIME_ZONE setting: How does it work?

2007-08-19 Thread Michael Elsdoerfer
I'm having some trouble with time zones on my production machine (debian, apache prefork with mod_python). On Windows, everything works as expected. I'm running the trunk from maybe two weeks ago. Basically, I have TIME_ZONE = 'GMT+1', but while datetime.datetime.today() in a vanilla python

Re: TIME_ZONE setting: How does it work?

2007-08-19 Thread Malcolm Tredinnick
On Sun, 2007-08-19 at 11:15 +0200, Michael Elsdoerfer wrote: > I'm having some trouble with time zones on my production machine (debian, > apache prefork with mod_python). On Windows, everything works as expected. > I'm running the trunk from maybe two weeks ago. More accurately, on Windows,

Re: TIME_ZONE setting: How does it work?

2007-08-19 Thread Malcolm Tredinnick
On Sun, 2007-08-19 at 19:54 +1000, Malcolm Tredinnick wrote: [...] > So, either use something like "CET-2" or use the more descriptive names. > These names used to be in the PostgreSQL documentation, but I just > noticed that they have been removed in the latest version. So check a > slightly

ImageField via admin

2007-08-19 Thread Grigory Fateyev
Hello! I have simple class with ImageField, but cann't add any object: class Book(models.Model): name = models.CharField(_('Book Title'), maxlength=200) book_number = models.IntegerField() image = models.ImageField(upload_to='%Y/%m/%d/', core=True,

Question: trailing escaped character in a href=""?

2007-08-19 Thread Drasty
I'm getting an escaped double quotation mark (", rendered as '%22') at the end of some stuff that I'm using to reference an anchor on the same page. This isn't a problem in templates, since the links and corresponding anchors are generated. But if I want to enter a link in, say, a TextField to

Re: Question: trailing escaped character in a href=""?

2007-08-19 Thread olivier
Hi, On 19 août, 19:07, Drasty <[EMAIL PROTECTED]> wrote: > class Thing(models.Model): > words = models.TextField() > note = models.IntegerField() > > def note_anchor(self): > return self.note > > (Input:) > > words = 'Blah blah.' > note = '1' In your example,

A IntegerField can't have value=0 when blank=False???

2007-08-19 Thread SH
I wanted to ask here before I post a ticket. If you have an integer field in your model, it can't equal zero if the field is required (blank=False) Here's the code out of Field.validate_full that causes this: if not self.blank and not field_data: return [_('This field is required.')] Am I

Re: A IntegerField can't have value=0 when blank=False???

2007-08-19 Thread Malcolm Tredinnick
On Sun, 2007-08-19 at 17:31 +, SH wrote: > I wanted to ask here before I post a ticket. > > If you have an integer field in your model, it can't equal zero if the > field is required (blank=False) That would definitely be a bug. Regards, Malcolm -- Everything is _not_ based on faith...

Re: Question: trailing escaped character in a href=""?

2007-08-19 Thread Drasty
No, I'm using MySQL. The same thing happens with a SlugField, so I'm not sure if the string/integer difference matters here. To return 'note' as an integer, would I write: def note_anchor(self): return int(self.note) or something else? On Aug 19, 12:21 pm, olivier <[EMAIL PROTECTED]>

Re: Question: trailing escaped character in a href=""?

2007-08-19 Thread olivier
> def note_anchor(self): > return int(self.note) If it's already an integer, you don't need to do this,do you ? Otherwise, are you not using a buggy middleware that tries to refactors your html to make it valid XHTML ? If not, I'm afraid I don't have any clues... Olivier

Re: wiki design

2007-08-19 Thread Kai Kuehne
Hi Carl, On 8/19/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > > I am trying do design a iddy biddy site that will replace a site that is only > about 8 static pages. I want to make it wiki-ish, so the 'site admin' can > tweak > things now and then, and it needs pictures. so sort of a hybrid

Re: Question: trailing escaped character in a href=""?

2007-08-19 Thread Drasty
Sorry, I got confused about your input question re: the note integer. (The confusion is from my accidental use of single quotes around the input note value.) I'm afraid I'm not using any buggy middleware, unless the stuff in django.contrib is buggy. I'll investigate to see if will successfully

RE: TIME_ZONE setting: How does it work?

2007-08-19 Thread Michael Elsdoerfer
Malcom, Thank you for the elaborate explanation. That fixed the problem, and I actually understood it ;) Michael > -Original Message- > From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] > On Behalf Of Malcolm Tredinnick > Sent: Sunday, August 19, 2007 11:54 AM > To:

User templates: store in the db or as files on the server?

2007-08-19 Thread Austin Govella
I want templates to be accessible and editable via my admin interface (not *the* admin). My question is about the best way to achieve this? Should templates be stored in the database? Or should they be stored in a templates directory and sucked into a textarea for editing? This is for a

recursive relationship foreignkey

2007-08-19 Thread Francis Lavoie
Hi, I'm trying to implement a recursive relationship with a foreignkey, but I failed to make it work. My goal is to have a table containing different categories and sub categories of equipment. the relationship with 'self' is for the subcategories. But I can't create the Master categories.

Welcome to CHirkut!!

2007-08-19 Thread chirkut
Welcome to Chirkut !! An Online Community site for Friends... visit www.chirkut.co.in Chirkut is an online community website designed for friends. The main goal of our service is to make your social life, and that of your friends, more active and stimulating. Chirkut`s social

Re: recursive relationship foreignkey

2007-08-19 Thread olivier
Hi, On 19 août, 21:51, Francis Lavoie <[EMAIL PROTECTED]> wrote: > I'm trying to implement a recursive relationship with a foreignkey, but I > failed to make it work. > If I dont use blank=True, the admin interface doesn't let me add the > category, otherwise I received the error. You need

Modification of URLField

2007-08-19 Thread eXt
Hello! What should I do to modify behavior of the URLField in the Admin Panel? I'd like to have a field that behaves like the URLField but doesn't require 'http://' part in it's value. Is it possible at all? I never used old style forms, so the code is not very readable to me. Regards --

clean method for auto generated forms (newforms)

2007-08-19 Thread [EMAIL PROTECTED]
I'm hoping to get a sanity check for how I'm using the clean method. I'm using new forms and I wanted to do a sanity covering the relationship of two different fields. The form as auto created with form_for_instance and friends was just fine, I just needed a "clean()" method of my choosing. I

Float Field not displaying the two zeros at the end of a price

2007-08-19 Thread Greg
I have a FloatField called price that stores the price of different elements. When the price is 19.99, 19.79, 19.01 etc... everything is displayed correctly. However, when I have a price of 19.00. The price when viewed in a browser is just 19. Is there anyway that I can have it display the

Attribute Error

2007-08-19 Thread MikeHowarth
Hi I was wondering whether anyone can help me out. I'm currently creating a form to register users, what I'm finding is that when I then attempt to save the user within the Register:save method I'm getting an attribute error when trying to access the title attribute. I've tried referencing both

Re: Float Field not displaying the two zeros at the end of a price

2007-08-19 Thread James Bennett
On 8/19/07, Greg <[EMAIL PROTECTED]> wrote: > I have a FloatField called price that stores the price of different > elements. When the price is 19.99, 19.79, 19.01 etc... everything is > displayed correctly. However, when I have a price of 19.00. The > price when viewed in a browser is just

Re: Attribute Error

2007-08-19 Thread [EMAIL PROTECTED]
As a first guess I'm not sure that user = User is doing what you would want. I think instead you want to instantiate a new User object. All you are doing right now is creating an alias user for User. On Aug 19, 3:16 pm, MikeHowarth <[EMAIL PROTECTED]> wrote: > Hi I was wondering whether anyone

Re: Attribute Error

2007-08-19 Thread MikeHowarth
I'll take a look at that. Even commenting that line out and attempting to access self.title I'm still getting an attribute error thrown: 'Register' object has no attribute 'title' On Aug 19, 10:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > As a first guess I'm not sure that user =

List comprehension with unique, sorted values

2007-08-19 Thread Chris Hoeppner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there! I thought this is just the kind of questions you love :) I haven't been able to find concise information about this on the net. I need to construct a choices var for a field widget at runtime, with the data from my database. Actually, I

Re: List comprehension with unique, sorted values

2007-08-19 Thread Kai Kuehne
Hi, On 8/19/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi there! > > I thought this is just the kind of questions you love :) > > I haven't been able to find concise information about this on the net. > > I need to construct a choices var

Re: recursive relationship foreignkey

2007-08-19 Thread Francis Lavoie
Hi, I still have this error with null=True . model.py: class Category(models.Model): name = models.CharField(max_length=36) description = models.CharField(max_length=200) parent = models.ForeignKey('self', null=True, blank=True) class Admin: # Admin options go here

Re: List comprehension with unique, sorted values

2007-08-19 Thread Kai Kuehne
I should have mentioned that I found such a function in the ASPN cookbook. Hope this helps (a bit)! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: List comprehension with unique, sorted values

2007-08-19 Thread Nathaniel Whiteinge
> It works like a charm, but I'm obviously getting duplicates, and the > choices are not sorted. Looks like set() may do the job (I've never used it, but I'm glad to learn about those related functions). Another option may be tacking distinct() onto your query. .. _distinct:

application and project coupling in unittests

2007-08-19 Thread Viraj Alankar
Hi, I've just started playing around with Django and have a question on unittesting. The docs mention that tests are looked for in the models.py files of applications and a tests.py file in the application directory. This seems to let me write tests specific to the application. However, when

Re: clean method for auto generated forms (newforms)

2007-08-19 Thread Russell Keith-Magee
On 8/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > forms.models.form_for_instance(original_laborder, form=LabOrderForm) > > Is there a more django-esque to get a custom clean method for an auto- > generated form like this or is this the way it's supposed to go? There's actually two

Re: Float Field not displaying the two zeros at the end of a price

2007-08-19 Thread Vincent Foley
{{ price|floatformat:2 }} On Aug 19, 4:44 pm, Greg <[EMAIL PROTECTED]> wrote: > I have a FloatField called price that stores the price of different > elements. When the price is 19.99, 19.79, 19.01 etc... everything is > displayed correctly. However, when I have a price of 19.00. The > price

Django app for locations? (countries, provinces, cities, venues...)

2007-08-19 Thread Austin Govella
Is there an existing Django app for managing locations? Specificall, countries, states/provinces, cities, and specific locations with addresses. (I was just adding such an app to my project, but thought I might be duplicating someone better effort...) Thanks, -- Austin Govella Thinking &

Re: application and project coupling in unittests

2007-08-19 Thread Russell Keith-Magee
On 8/20/07, Viraj Alankar <[EMAIL PROTECTED]> wrote: > My question is why does my test in polls need to know anything about > the root url configuration of the project? This seems to couple my > poll-specific unittest to the project and it would be cleaner to not > need to specify the '/polls/'

Re: Question: trailing escaped character in a href=""?

2007-08-19 Thread Kai Kuehne
Hi, On 8/19/07, Drasty <[EMAIL PROTECTED]> wrote: > I'll investigate to see if will successfully point > to , though I have my doubts! Which version of django do you use? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Attribute Error

2007-08-19 Thread Doug B
I think you've got some misconceptions about newforms. http://www.djangoproject.com/documentation/newforms/ should give you the info you need. Something more like this: def save(self): #set up the objects we are going to populate user = User() # you want a new -instance- not another

Re: ImageField via admin

2007-08-19 Thread Carl Karsten
Grigory Fateyev wrote: > Hello! > > I have simple class with ImageField, but cann't add any object: > > class Book(models.Model): > name = models.CharField(_('Book Title'), maxlength=200) > book_number = models.IntegerField() > image = models.ImageField(upload_to='%Y/%m/%d/',

quiz design

2007-08-19 Thread Ramdas S
Hi, Has anyone worked on a quiz/ multiple choice contest design using Django using Newforms? RS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Closed

2007-08-19 Thread Drasty
It was a typo. Everything works now. Sorry for the fuss! On Aug 19, 12:07 pm, Drasty <[EMAIL PROTECTED]> wrote: > I'm getting an escaped double quotation mark (", rendered as '%22') at > the end of some stuff that I'm using to reference an anchor on the > same page. This isn't a problem in

Re: Float Field not displaying the two zeros at the end of a price

2007-08-19 Thread Greg
Vincent and James, I tired both of your suggestions and I couldn't get either to work. First, still using my prices as FloatFields. I added the following to my template: {{ a.price|floatformat:2 }}. When I tried this I got the following error: TypeError float() argument must be a string or a

Re: Cache middleware causing unit tests to fail

2007-08-19 Thread Norman Harman
Eratothene wrote: > I think you better not disable cache middleware in tests. If tests > fail, so will be in production. I had similar problem, I thought it > was something wrong with tests, but really it was problem in the code. > My site was running well on django built-in server, but not on

Re: clean method for auto generated forms (newforms)

2007-08-19 Thread [EMAIL PROTECTED]
Ah, yes, sort of obvious in retrospect. But at least I was in the neighborhood of a sane way of using it. Thanks. On Aug 19, 5:49 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 8/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > >

Re: How to install django on Apache/Linux

2007-08-19 Thread Graham Dumpleton
On Aug 19, 11:04 pm, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > If my site is under /var/www/html/python, with the settings file as / > > var/www/html/python/foo/settings.py should I write, > > SetEnv DJANGO_SETTINGS_MODULE foo.settings > >

Re: Float Field not displaying the two zeros at the end of a price

2007-08-19 Thread Greg
Jake, No I didn't. When I tried the 'floatformat:2' I made sure that my model fields were of type FloatField. When I do use the 'floatformat: 3' and view the template. I notice that in my error message my for statement is highlighted: TypeError at /rugs/milliken/border/ionica/ float()

Mod_Python and Apache

2007-08-19 Thread Sasha Weberov
Is it normal to experience a sudden sharp spike in cpu and memory usage for about a minute or so after a start/stop and restart? I'm running the pre-fork mpm, FreeBSD 6.2, and latest mod_python. I've tried disableing mod_python and it went away, so it's clearly mod python. I know that the

Re: recursive relationship foreignkey

2007-08-19 Thread Malcolm Tredinnick
On Sun, 2007-08-19 at 18:41 -0400, Francis Lavoie wrote: > Hi, > > I still have this error with null=True . > > model.py: > class Category(models.Model): > name = models.CharField(max_length=36) > description = models.CharField(max_length=200) > parent = models.ForeignKey('self',

Re: Attribute Error

2007-08-19 Thread Malcolm Tredinnick
On Sun, 2007-08-19 at 14:30 -0700, MikeHowarth wrote: > I'll take a look at that. > > Even commenting that line out and attempting to access self.title I'm > still getting an attribute error thrown: 'Register' object has no > attribute 'title' Doug Ballanc has explained how you should be