Re: Django not working with FCGI

2006-08-12 Thread jws
First of all, If you read the last few lines, It looks like you don't have the Mysql package loaded in python. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Frameworks, Documentation and the Joy of Django

2006-08-12 Thread jws
Partially inspired by the discussion at http://www.jrandolph.com/blog/?p=45 regarding evaluating frameworks, I'd like to make an observation. Within the Python web framework ecosystem(and I mean for ecosystem to imply a mind-bendingly complex system of interconnected parts) we don't really 'get'

Re: Re: Re: Max datetime

2006-08-12 Thread James Bennett
On 8/12/06, James Bennett <[EMAIL PROTECTED]> wrote: > A little validation in the save() method for Price (or maybe even a > custom validator) to ensure that only one "active" price exists for a > given Material at any time, and you're good to go; given an instance > of Material, say in a

Re: Re: Max datetime

2006-08-12 Thread James Bennett
On 8/12/06, Vizcayno <[EMAIL PROTECTED]> wrote: > For material-1 I know that the price $13.59 is valid from 2006-05-04 to > the infinite, until a new price is established for this material. ..snip... > If a record has the field date/time="2999-12-31 23:59:59" it means it > is in effect, but if

Re: Max datetime

2006-08-12 Thread Vizcayno
It is about temporality of a record. Suppose I have a price table for each material: Material Price Valid to - material-1 $12.50 2006-01-01 material-1 $12:52 2006-05-03 material-1 $13:59 2999-12-31 material-2 $54.32 2999-12-31

Re: models that reference each other through foreign key

2006-08-12 Thread Kenneth Gonsalves
On 12-Aug-06, at 3:45 PM, Maciej Bliziński wrote: >> committee = models.ForeignKey( 'Committee' ) > > You shouldn't use the string argument (I mean, I never do that). And > what if one person is in two committees? since the class 'Committee' is not yet defined, it wont work without the

Django not working with FCGI

2006-08-12 Thread cypher543
I've decided to code my new site with Django, becuase I've grown tired of PHP and I've always loved Python. So, I followed a guide written by my webhost that tells how to setup Django on their server using FCGI. Here is the guide: http://wiki.asmallorange.com/HOWTODjangoFastCGI I followed

Re: Max datetime

2006-08-12 Thread Adrian Holovaty
On 8/12/06, Vizcayno <[EMAIL PROTECTED]> wrote: > You will agree however that "default=datetime.max" would have been a > clean solution (not hardcoding) to establish the maximum date/time into > the models.py file, unless you kindly suggest me another. Actually, I don't see how

Re: Max datetime

2006-08-12 Thread Vizcayno
Adrian: Thanks for your attention and answer. You will agree however that "default=datetime.max" would have been a clean solution (not hardcoding) to establish the maximum date/time into the models.py file, unless you kindly suggest me another. Thanks again!!

Re: Converting characteres non-ASCII in the templates

2006-08-12 Thread limodou
On 8/13/06, GinTon <[EMAIL PROTECTED]> wrote: > > To convert the names to lower or UPPER case in the templates is used {{ > foo.name|lower }} and {{ foo.name|upper }} > > But is possible convert characters non-ASCII? Is there any of use > foo.name.decode('utf-8').upper() in the templates? > >

Re: Max datetime

2006-08-12 Thread Adrian Holovaty
On 8/12/06, Vizcayno <[EMAIL PROTECTED]> wrote: > end_date = models.DateTimeField('End date'', default=datetime.max) > > end_time value is = -12-31 23:59:59 > > However Django indicates it is not a valid date when I want to save a > record. > What is wrong? Hi Vizcayno, The Django date

Re: Deploy Django into a subfolder/subdirectory

2006-08-12 Thread Adrian Holovaty
On 7/25/06, Chris H. <[EMAIL PROTECTED]> wrote: > I'm trying to deploy Django into a subfolder of a domain, > http://www.mydomain.com/projects/ > > I can call up http://www.mydomain.com/projects/admin/ and I get the > login screen OK, but when I successfully log in I get sent to >

Max datetime

2006-08-12 Thread Vizcayno
Hi: I have next code: from datetime import datetime . . . end_date = models.DateTimeField('End date'', default=datetime.max) end_time value is = -12-31 23:59:59 However Django indicates it is not a valid date when I want to save a record. What is wrong? Regards

Re: Preview updates from auto-admin(?)

2006-08-12 Thread Adrian Holovaty
On 7/29/06, ToddG <[EMAIL PROTECTED]> wrote: > Is there any way to preview updates in the auto-admin? From what I can > tell the answer is "no". Yeah, we don't have support for previewing data in the admin site. Some fun trivia, though, is that we used to have something like this, in old-school

Re: Accessing debug items in a template

2006-08-12 Thread Adrian Holovaty
On 7/29/06, skullvulture <[EMAIL PROTECTED]> wrote: > I want to do: > > > Home > Shows > Merch > > > > SCRIPT_URL is an item that print with debug when I add {% debug > %}, and it's value is '/home/ when I'm on the home page. However, > I can't access the value of that variable. > > Is there a

Re: How to make delete() more clever?

2006-08-12 Thread Malcolm Tredinnick
On Sat, 2006-08-12 at 21:56 +0400, Ivan Sagalaev wrote: > 一首诗 wrote: > > But how can I give some information to user that the delete is not > > allowed? > > By the codes above, the user just see that the delete was done! > > This is exactly the case for using exceptions. Define your own

Re: Non-database fields on the admin side?

2006-08-12 Thread Adrian Holovaty
On 8/4/06, medhat <[EMAIL PROTECTED]> wrote: > Is there an easy way to create filds on the admin side that don't have > database columns behind them? I am thinking of something whose value > will drive some functionality in the save() method in the model, but > does not need to be saved. Hey

Re: Simplifying template?

2006-08-12 Thread Adrian Holovaty
On 7/31/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > I would actually be okay writing the function in the view code, if we > had a map filter. > > {{ s.teachers|map:list_func|join:";" }} > > Then add the following to the context: > > "list_func": lambda(x): x.userinfo.informal_name() > > How

Re: How to find currently active sessions?

2006-08-12 Thread Adrian Holovaty
On 7/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is there a way to find currently active sessions, out of all sessions > stored in the database? > Say I want to put a "users currently active" box on my page (*), how > would I do that. I've had a look at the session model but didn't find

Re: edit in admin change list?

2006-08-12 Thread Adrian Holovaty
On 7/25/06, Tamara D. Snyder <[EMAIL PROTECTED]> wrote: > I am wondering if there is a way to make changes from the admin > change list, instead of only from the admin edit list. > > For example, I have a model called "stories" that have a boolean > field called "visible." In order for the story

Re: Converting characteres non-ASCII in the templates

2006-08-12 Thread Adrian Holovaty
On 8/12/06, GinTon <[EMAIL PROTECTED]> wrote: > To convert the names to lower or UPPER case in the templates is used {{ > foo.name|lower }} and {{ foo.name|upper }} > > But is possible convert characters non-ASCII? Is there any of use > foo.name.decode('utf-8').upper() in the templates? Hi

Re: Forcing a view to expire from cache

2006-08-12 Thread Maciej Bliziński
On Sat, 2006-08-12 at 22:17 +, ToddG wrote: > What you probably want is the low-level cache API, and use it to store > the results of your long-running calculations. Since you're setting the > entry in the cache the key generation is up to you. So you wont' be > caching at the page or view

Re: django + lighttpd on FreeBSD, possible CACHE_BACKEND problem?

2006-08-12 Thread Wiktor Grębla
Wiktor Grębla napisał(a): > I was thinking about it for a while, and I found another simple > problem. Setting the cache the way I do is also error-prone. I use the > same cache keys for different connections, so every time a user > connects and the cache is saved (wherever I think it's sane

Re: Re: Using custom forms with generic views

2006-08-12 Thread Jeff Mikels
Great! That's exactly what I wanted! Thanks. On 8/8/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > another alternative you may want to consider is to piggybak ontop of the > generic view > > have a look > at > http://svn.zyons.python-hosting.com/trunk/zilbo/common/utils/views/create_update.py

Re: Forcing a view to expire from cache

2006-08-12 Thread Maciej Bliziński
On Sat, 2006-08-12 at 21:17 +, ToddG wrote: > Maciej, you mentioned "turned on the caching" -- that sounds like using > the caching middleware, not the view-level cache functionality. Or am I > guessing wrong? You're guessing right. Sorry for not being specific enough. > To my understanding

Re: django + lighttpd on FreeBSD, possible CACHE_BACKEND problem?

2006-08-12 Thread Wiktor Grębla
Eugene Lazutkin napisał(a): > 'locmem:///' is a thread-safe process-local memory cache. Every process > has its own unique instance. Why? It was meant to be used for caching of > immutable, but expensive-to-calculate values. In your case (making a > global snapshot of a variable) it'll create

Re: Forcing a view to expire from cache

2006-08-12 Thread ToddG
Maciej, you mentioned "turned on the caching" -- that sounds like using the caching middleware, not the view-level cache functionality. Or am I guessing wrong? To my understanding if you need to be able to manuallly get and clear cached pages you'll need to use the view level caching, not the

Re: Re: Forcing a view to expire from cache

2006-08-12 Thread James Bennett
On 8/12/06, Maciej Bliziñski <[EMAIL PROTECTED]> wrote: > It's fine, except the trailing MD5 sum. Is there a way to guess the key > of the view? Otherwise, I could use SQL to find everything that begins > with "views.decorators.cache.cache_page.myprefix./myproject/something/" > and nuke it, but

Re: Forcing a view to expire from cache

2006-08-12 Thread Maciej Bliziński
On Sat, 2006-08-12 at 13:13 -0700, Don Arbow wrote: > On Aug 12, 2006, at 12:38 PM, Maciej Bliziński wrote: > > > > This is a data-analysis site, and after I change some parameters, I > > want > > to clear the cache for one of the views. How can I force a view to > > expire? > > Take a look at

Re: Installing

2006-08-12 Thread Eugene Lazutkin
Dennis wrote: > hello to all I am new in the use of Django, I find it very interesting. > But I have not been able to install it, I think is because I have > windows. If somebody could say me, How I can install it, I would thank > it to him a lot. Greetings. Some time ago I created a simple

Re: django + lighttpd on FreeBSD, possible CACHE_BACKEND problem?

2006-08-12 Thread Eugene Lazutkin
Wiktor Grębla wrote: > > I've a "testing" Django configuration with lighttpd (flup + > django-fastcgi.py) on FreeBSD. Everything seems to work fine, but there > is one thing "misbehaving": cacheing when CACHE_BACKEND = 'locmem:///'. ... > If I set CACHE_BACKEND = 'db://some_table' it's working

Re: Forcing a view to expire from cache

2006-08-12 Thread Don Arbow
On Aug 12, 2006, at 12:38 PM, Maciej Bliziński wrote: > > This is a data-analysis site, and after I change some parameters, I > want > to clear the cache for one of the views. How can I force a view to > expire? Take a look at the example just above the "Upstream Caches" paragraph. It shows

Forcing a view to expire from cache

2006-08-12 Thread Maciej Bliziński
Hello, Djangoers, I've got a site where some pages take really long to calculate and display (~40s), so I've turned on the caching and it works like a breeze. I'm amazed. This is a data-analysis site, and after I change some parameters, I want to clear the cache for one of the views. How can I

Re: Installing

2006-08-12 Thread propell
On effbot.org you can find the article "Installing Django on Windows in less than 5 minutes": http://effbot.org/zone/django.htm#installing Maybe that can help you gettings started. - Kjell Magne Fauske --~--~-~--~~~---~--~~ You received this message because you

Re: Public Domain ( was Re: Full Text Search w/ MySQL)

2006-08-12 Thread Jan Claeys
Op vr, 04-08-2006 te 16:55 +1000, schreef Ian Holsman: > To quote the paper: This “Give-It-Away” license provides no protection > for anyone if the donated software causes harm. > > ie.. even if you didn't mean it, if I used a piece of public domain > code in a app I write and it fails, i can

Converting characteres non-ASCII in the templates

2006-08-12 Thread GinTon
To convert the names to lower or UPPER case in the templates is used {{ foo.name|lower }} and {{ foo.name|upper }} But is possible convert characters non-ASCII? Is there any of use foo.name.decode('utf-8').upper() in the templates? Thanks in advance!

Re: How to make delete() more clever?

2006-08-12 Thread Ivan Sagalaev
一首诗 wrote: > But how can I give some information to user that the delete is not > allowed? > By the codes above, the user just see that the delete was done! This is exactly the case for using exceptions. Define your own exception and raise it where user shouldn't delete an object. Then define a

Re: Installing

2006-08-12 Thread Bryan Chow
More information please. What steps have you taken to install Django? Have you read the installation guide? There are some tips for installing Django on Windows in the comments. http://www.djangoproject.com/documentation/install/ Bryan On 8/12/06, Dennis <[EMAIL PROTECTED]> wrote: > hello to

django + lighttpd on FreeBSD, possible CACHE_BACKEND problem?

2006-08-12 Thread Wiktor Grębla
Hi. I've a "testing" Django configuration with lighttpd (flup + django-fastcgi.py) on FreeBSD. Everything seems to work fine, but there is one thing "misbehaving": cacheing when CACHE_BACKEND = 'locmem:///'. In my views I often use something like: images = cache.get('images') entries =

How to make delete() more clever?

2006-08-12 Thread 一首诗
I want to override delete() === from django.db import models class Person(models.Model): first_name = models.CharField(maxlength=20) last_name = models.CharField(maxlength=20) def delete(self): if ( A ): super(Person,

Installing

2006-08-12 Thread Dennis
hello to all I am new in the use of Django, I find it very interesting. But I have not been able to install it, I think is because I have windows. If somebody could say me, How I can install it, I would thank it to him a lot. Greetings. --~--~-~--~~~---~--~~ You

Re: VMWare image for running/developing Django

2006-08-12 Thread Jan Claeys
Op vr, 04-08-2006 te 15:43 -0700, schreef Joseph Heck: > Ah - brilliant. (Thanks for the "Shrink" tip - I looked around and > couldn't find anywhere to invoke it up). That's got it down to just at > 1Gb. An Ubuntu live-cd fits on a 650 MiB CD-R, while it includes lots of software that you don't

Re: Multiple copies of a Block in my Template

2006-08-12 Thread Siah
Thanks you guys. Sia --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL

Re: Compress images on upload?

2006-08-12 Thread Bryan Chow
Hi Jay, Here's a custom field that automatically resizes the uploaded image using PIL. You should be able to modify save_file() to adjust the JPEG compression level on pil_obj.save() In fact we might add this as an optional parameter in the next version. http://www.verdjn.com/wiki/PhotoField

Re: access MEDIA_URL in templates

2006-08-12 Thread Bryan Chow
+1 for James' excellent tutorial. Here's the context processor that I use in most of my projects: http://www.verdjn.com/wiki/Siteroot http://www.verdjn.com/browser/verdjnlib/context_processors/__init__.py --~--~-~--~~~---~--~~ You received this message because

Re: Anyone at LinuxWorld next week?

2006-08-12 Thread Deryck Hodge
On 8/11/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 8/11/06, Deryck Hodge <[EMAIL PROTECTED]> wrote: > > Anyone planning to attend LinuxWorld next week? I'll be there doing a > > tutorial on Monday, but I have free time Monday night and Tuesday > > night. I don't mind trying to get an

Re: models that reference each other through foreign key

2006-08-12 Thread Bryan Murdock
On 8/12/06, Maciej Bliziñski <[EMAIL PROTECTED]> wrote: > > On Fri, 2006-08-11 at 22:02 -0700, Bryan Murdock wrote: > > First I must admit that I'm a databse dummy. I'm using fairly recent > > django code from svn. I have a simple desire. I want people who can > > be organized into committees,

Re: access MEDIA_URL in templates

2006-08-12 Thread dummy
Hi, thanks for the hints, that exactly what I was looking for. May I'm not the first who asked this question. The solution maybe should be placed somewhere on the django-wiki ? Or the context_processor.media_url should go into the django-distro ? Regards, Dirk -- Der GMX SmartSurfer hilft

Re: access MEDIA_URL in templates

2006-08-12 Thread James Bennett
On 8/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > is it possible to get the value of MEDIA_URL from settings.py in the > templates ? You can write a template context processor, and use the `RequestContext` subclass of the normal Context. See the official documentation (and list of

Re: access MEDIA_URL in templates

2006-08-12 Thread limodou
On 8/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi all, > > is it possible to get the value of MEDIA_URL from settings.py in the > templates ? > > Regards, > Dirk You can pass it manually through Context, for example: from django.conf import settings ... return

access MEDIA_URL in templates

2006-08-12 Thread dummy
Hi all, is it possible to get the value of MEDIA_URL from settings.py in the templates ? Regards, Dirk -- "Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail --~--~-~--~~~---~--~~ You received this

Re: Datetime and a template tag

2006-08-12 Thread PythonistL
Malcom, Thank you very much for your time and help. I found the reason of my problem. I had two different template tags but in both the same context variable and one overwrote the other. Best regards, L. --~--~-~--~~~---~--~~ You received this message because

Re: models that reference each other through foreign key

2006-08-12 Thread Maciej Bliziński
On Fri, 2006-08-11 at 22:02 -0700, Bryan Murdock wrote: > First I must admit that I'm a databse dummy. I'm using fairly recent > django code from svn. I have a simple desire. I want people who can > be organized into committees, with each committee having a committee > leader, also a person.

Re: Template including

2006-08-12 Thread limodou
On 8/12/06, Michal <[EMAIL PROTECTED]> wrote: > > Hello, > I was trying to include some of the menu templates according to > flatpage.url variable (I have several local menu templates): > > {% include flatpage.url|menu %} > > But this doesn't work. It seems to me, that flatpage.url|menu isn't >

Re: imbricated tags

2006-08-12 Thread spacedman
[EMAIL PROTECTED] wrote: > I just tried two loops "for" imbricated, it does'nt seems to work. Imbricated? That's a new one on me. I just looked it up and it means overlapping like roof tiles, edge over edge, which makes me think of two for loops like this: for i = 1 to 10 for j = 1 to 10 print

Re: stripogram as middleware or templatetag

2006-08-12 Thread dummy
Hi, thank you Ian for the link. I saw a post for SavePost.py, but with a broken link. Brian, I thought to implement a templatetag SAFEHTML, since I came through the admin_doc which has nice links on the doc-model for cross referencing models. But those links will be escaped through a policy