django on FreeBDS

2007-07-13 Thread Przemek Gawronski
Hi, a hosting company has installed django for me on their system (FreeBSD 6.2-RELEASE-p5). When I try to run (ssh under jailshell): 'django-admin.py startproject test' I get: Traceback (most recent call last): File "/usr/local/bin/django-admin.py", line 5, in ?

Re: Looking for 2 great python/django developers in Atlanta area

2007-07-13 Thread Todd O'Bryan
On Sat, 2007-07-14 at 13:46 +1000, Malcolm Tredinnick wrote: > Umm... the world is a fairly big place. Where in it are you located? > > Malcolm See subject. :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: model subclassing

2007-07-13 Thread Malcolm Tredinnick
On Fri, 2007-07-13 at 21:31 -0500, Carl Karsten wrote: > I am experimenting with subclassing a model. The parent class will be an > abstract class that does not get 'managed' by django. Only the subclass > will, > and the table the subclass works with will have all the fields. > > syncdb

Re: Looking for 2 great python/django developers in Atlanta area

2007-07-13 Thread Malcolm Tredinnick
On Fri, 2007-07-13 at 16:47 +, Chris H. wrote: > Our web development team is looking for experienced Python/Django Web > developers. > > We're a small group practicing agile and rapid development looking to > grow bigger. > > This is not a typical, "hand me a spec and I'll build it" shop.

Re: Difference between a model's field and it's translated version - admin

2007-07-13 Thread Malcolm Tredinnick
On Fri, 2007-07-13 at 16:19 +, Panos Laganakos wrote: > If I have the model specified as: > > class Candy(models.Model): > name = models.CharField(_('name'), maxlength=25) > > The admin section, displays the field as, 'Name', while the translated > version will appear as 'onoma', ie,

Re: installation issues

2007-07-13 Thread surfwizz
Sorry about that. Thanks for the tip on using copy/paste. Here's the result for that: new-host-3:~ wdavis$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages On Jul 13, 6:49 pm, Carl

Re: model subclassing

2007-07-13 Thread Lars Stavholm
Carl Karsten wrote: > I am experimenting with subclassing a model. The parent class will be an > abstract class that does not get 'managed' by django. Only the subclass > will, > and the table the subclass works with will have all the fields. > > syncdb was able to create the table I

model subclassing

2007-07-13 Thread Carl Karsten
I am experimenting with subclassing a model. The parent class will be an abstract class that does not get 'managed' by django. Only the subclass will, and the table the subclass works with will have all the fields. syncdb was able to create the table I expected, the admin let me add and save

Re: Users?

2007-07-13 Thread theju
Check out the Django-registration package on http://code.google.com/p/django-registration that has all the features that you require. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: installation issues

2007-07-13 Thread Carl Karsten
you missed the -c guessing you need to figure out how to cut/paste into your terminal. I think it is action-v for paste, where action is the cloverleaf. Carl K surfwizz wrote: > Here's what that looks like: > new-host-3:~ wdavis$ python "from distutils.sysconfig import > get_python_lib;

Re: installation issues

2007-07-13 Thread surfwizz
Here's what that looks like: new-host-3:~ wdavis$ python "from distutils.sysconfig import get_python_lib; print get_python_lib()" /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/ Contents/MacOS/Python: can't open file 'from distutils.sysconfig import get_python_lib; print

Re: installation issues

2007-07-13 Thread Carl Karsten
run this command, show us what you get: python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" So like this: [EMAIL PROTECTED]:~$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" /usr/lib/python2.5/site-packages Carl K surfwizz

Re: installation issues

2007-07-13 Thread surfwizz
I could not find any folders at the lib location. To clarify how the IDLE thing went, I tried running sudo python setup.py, but it didn't work, so I opened setup.py in IDLE, Then went to 'run', in the menubar, and clicked 'run module'. It prompted me to save it, so I did. that was the whole

Re: form processing

2007-07-13 Thread Mackenzie
Thanks for your help I was not understanding why I could not get both values. On Jul 13, 3:10 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > > I have a form on one of my pages that has two fields with the same > > name. When I process the POST in my view I only get one of the values > >

Users?

2007-07-13 Thread imaspen
How would I make a site that has Users that can register/make a profile? --~--~-~--~~~---~--~~ 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

Re: Does anybody know how to make a PICTURE database in Django???

2007-07-13 Thread [EMAIL PROTECTED]
On Jul 13, 10:49 pm, Naco <[EMAIL PROTECTED]> wrote: > Im a newby looking for some instructions on building a picture > database that is indexed. Would anybody know, have some instrucitons > or help out a newby That's really specific and all :) This might be of interest for you:

Re: html sanitizers

2007-07-13 Thread Derek Anderson
wow, this lib is great. danke. heh, love that feeling that i've been wasting my life coding scrapers with regexs up until now... :) patrick k. wrote: > it´s easy to write a customized sanitizer using beautifulsoup. > http://www.crummy.com/software/BeautifulSoup/ > > 1) place

Re: form processing

2007-07-13 Thread Jonathan Buchanan
> I have a form on one of my pages that has two fields with the same > name. When I process the POST in my view I only get one of the values > ( the last one ). > > EXAMPLE: > HTML > > > > DEBUG > POST: > > VIEW > request.POST['version'] > > the above line is = 35 if both checkboxes are checked

Re: form processing

2007-07-13 Thread [EMAIL PROTECTED]
The second value is overwriting the first. I don't think you can return a list unless you use a multi-select box. On Jul 13, 2:45 pm, Mackenzie <[EMAIL PROTECTED]> wrote: > I have a form on one of my pages that has two fields with the same > name. When I process the POST in my view I only get

Does anybody know how to make a PICTURE database in Django???

2007-07-13 Thread Naco
Im a newby looking for some instructions on building a picture database that is indexed. Would anybody know, have some instrucitons or help out a newby --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Errors in installing Django Trunk version on Windows xp

2007-07-13 Thread que0x
thanks for help, properly it works when passing the appropriate parameters. i was running it without passing parameters. sorry ,just started with Django ! On Jul 13, 8:09 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Looks like you've got a couple of problems. First the traceback seems to >

Re: flatpages issues

2007-07-13 Thread John-Scott Atlakson
Yes sir. I followed the examples in the official docs literally and in order (http://www.djangoproject.com/documentation/flatpages/#installation steps 1-3). That worked fine and I was able to immediately start creating flatpages via the admin interface. But I cannot view flatpages on the site. I

Re: html sanitizers

2007-07-13 Thread Derek Anderson
well, but sometimes you want them to be able to enter HTML. style items, simple links, etc... [EMAIL PROTECTED] wrote: > Yes it is much safer to reject rather than sanitize. If bad tags are > detected then reject the input out of hand. If you don't your > sanitizer could be turned against

Re: flatpages issues

2007-07-13 Thread Jacob Kaplan-Moss
Hi John-Scott -- Did you add 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware' to your ``MIDDLEWARE_CLASSES`` setting? Jacob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

form processing

2007-07-13 Thread Mackenzie
I have a form on one of my pages that has two fields with the same name. When I process the POST in my view I only get one of the values ( the last one ). EXAMPLE: HTML DEBUG POST: VIEW request.POST['version'] the above line is = 35 if both checkboxes are checked any ideas why I don't get

Re: little problem

2007-07-13 Thread JeffH
Jacob: Great! I have played it safe with the getattr construct, figuring that the new object instance _might_ be constructed with an id attribute set to None prior to save(). On Jul 13, 2:46 pm, "Lic. José M. Rodriguez Bacallao" <[EMAIL PROTECTED]> wrote: > thanks, that work more efficient that

Re: Can Google index Django's pages?

2007-07-13 Thread felixhummel
Thanks for this fine answer, Julio! Now nothing is going to hold me back! ;) On Jul 13, 8:22 pm, "Julio Nobrega" <[EMAIL PROTECTED]> wrote: > hi Felix, > > Yes, Google will index your website even if you use Django. The only > stuff that stop Google are the robots.txt, meta tags, and a

Re: little problem

2007-07-13 Thread Lic. José M. Rodriguez Bacallao
thanks, that work more efficient that my way of do it, I was getting the user from the database to see if the user exist. I like your solution, is pretty clean and simple. Thanks a lot. On 7/13/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > > On 7/13/07, JeffH <[EMAIL PROTECTED]> wrote: > >

Re: little problem

2007-07-13 Thread Jacob Kaplan-Moss
On 7/13/07, JeffH <[EMAIL PROTECTED]> wrote: > > if getattr(model_instance, 'id', None) is None: > model_instance.created_by = whatever > Also take a look at ``hasattr()``: http://docs.python.org/lib/built-in-funcs.html#l2h-35 Jacob --~--~-~--~~~---~--~~ You

Re: Can Google index Django's pages?

2007-07-13 Thread Julio Nobrega
hi Felix, Yes, Google will index your website even if you use Django. The only stuff that stop Google are the robots.txt, meta tags, and a direct request. Don't worry, if you can access your website using a browser, there's at least one link to it somewhere, and you didn't do any of the

Can Google index Django's pages?

2007-07-13 Thread felixhummel
Hi! Before I decide to dive into Django, could you please tell me if Google can crawl pages created by Django natively? I am running an Apache with mod_python. Does this matter? Thanks in advance! Felix --~--~-~--~~~---~--~~ You received this message because

Re: little problem

2007-07-13 Thread JeffH
this works for me: if getattr(model_instance, 'id', None) is None: model_instance.created_by = whatever On Jul 13, 1:28 pm, "Lic. José M. Rodriguez Bacallao" <[EMAIL PROTECTED]> wrote: > Hi, I got a little problem. I need to store in a model the first user who > created it (created_by) and

little problem

2007-07-13 Thread Lic. José M. Rodriguez Bacallao
Hi, I got a little problem. I need to store in a model the first user who created it (created_by) and the user who last modified it (last_modified_by). So, with the second one, there is no problem, every time a user save the object, the pre_save signal is dispatched and I catch it so I can set the

Re: Errors in installing Django Trunk version on Windows xp

2007-07-13 Thread Karen Tracey
Looks like you've got a couple of problems. First the traceback seems to indicate that django-admin doesn't like whatever arguments you have passed to it, so it attempts to print out its usage message. However then Python hiccups attempting to convert the message into your command prompt's code

Re: django + nginx: upstream split a header line in FastCGI records

2007-07-13 Thread globophobe
Atypically, the moment I petition for help I solve the problem myself. Solution: Use the latest development version b/c Changes with nginx 0.6.2 09 Jul 2007 *) Bugfix: if the FastCGI header was split in records, then nginx passed garbage in

Difference between a model's field and it's translated version - admin

2007-07-13 Thread Panos Laganakos
If I have the model specified as: class Candy(models.Model): name = models.CharField(_('name'), maxlength=25) The admin section, displays the field as, 'Name', while the translated version will appear as 'onoma', ie, the first letter isn't capitalized. The translated word is specified all

django + nginx: upstream split a header line in FastCGI records

2007-07-13 Thread globophobe
Does anyone know what this is about? 2007/07/14 00:35:54 [alert] 22564#0: *17 upstream split a header line in FastCGI records while reading response header from upstream, client: 127.0.0.1, server: localhost, URL: "/", upstream: "fastcgi:// unix:/tmp/django1.sock:", host: "localhost", referrer:

SQL VIEWs as Django Models for aggregation --- delete() issues with django.db.models.query: delete_objects

2007-07-13 Thread JeffH
This post relates to two separate Django issues that intertwined for me: 1. Lack of aggregation support in Django's ORM (I am delighted to see http://groups.google.com/group/django-developers/browse_thread/thread/f433edf7b0ebdbcb/ ) 2. Django does not use delete() methods for related objects (as

Problems with depth and select_related

2007-07-13 Thread Gary Doades
I seem to be having a bit of a problem with the depth parameter to select_related. If I have only simple relationships, i.e. only three tables involved linked by a simple foreign key chain it all *seems* to work OK. I get the right data in both model instances with just the one query issued

Errors in installing Django Trunk version on Windows xp

2007-07-13 Thread que0x
Hi all, i get the following errors while trying to run Django-admin.py : " Traceback (most recent call last): File "C:\\Python25\\Scripts\django-admin.py", line 5, in management.execute_from_command_line() File "C:\Python25\lib\site-packages\django\core\management.py", line 1623, in

Re: Avoiding HTTP 301 code using mod_python

2007-07-13 Thread Miguel Filho
On 7/13/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > You might want to have a look at: > > http://www.djangoproject.com/documentation/settings/#append-slash > Well just for the record, I have disabled CommonMiddleware and set APPEND_SLASH to False, both changes didn't work, I still get the

Re: select_related(), m2m, foreign(null=True)

2007-07-13 Thread jj
Sorry, here's the example. Or is there any simpler way to achieve the same thing? JJ. class Book(models.Model): title = ... main_author = ForeignKey(Author, null=True) co_authors = ManyToManyField(Author) class Reprint(models.Model): book = ForeignKey(Book) class

Re: Using Django without database

2007-07-13 Thread Mike Caldwell
I've done a lot of applications with this kind of concern. But it really doesn't change the design much. The web server goes on one side of the DMZ and the database server goes on the other. That probably should be the standard anyway, keep as little extraneous data as possible on the web

Getting debug with apache and mod_python

2007-07-13 Thread Alessandro Ronchi
With apache and mod_python, and this configuration: SetHandler python-program PythonHandler django.core.handlers.modpython PythonPath "['/home/django/django_projects/'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE legacoopfc.settings_corrierecooperativo PythonDebug On I cannot see 500 errors

Re: html sanitizers

2007-07-13 Thread Horst Gutmann
Brett Parker wrote: > On Fri, Jul 13, 2007 at 11:48:50AM +0100, Nic James Ferrier wrote: >> Brett Parker <[EMAIL PROTECTED]> writes: >> >>> On Fri, Jul 13, 2007 at 11:18:18AM +0100, Nic James Ferrier wrote: Derek Anderson <[EMAIL PROTECTED]> writes: > hey all, > > could

WeSearchit4u.com- new Search Assistance Service- Anyone tested it?

2007-07-13 Thread Alan Ab
Dear Friends. I would like to introduce a new search assistance service www.wesearchit4u.com. It is similar to Google Answers and Yahoo Answers, but a lot more professional. They call themselves search assistants and seem to search complicated information on the web for users of this site.

Re: html sanitizers

2007-07-13 Thread Brett Parker
On Fri, Jul 13, 2007 at 11:48:50AM +0100, Nic James Ferrier wrote: > > Brett Parker <[EMAIL PROTECTED]> writes: > > > On Fri, Jul 13, 2007 at 11:18:18AM +0100, Nic James Ferrier wrote: > >> > >> Derek Anderson <[EMAIL PROTECTED]> writes: > >> > >> > hey all, > >> > > >> > could anyone point

Re: html sanitizers

2007-07-13 Thread Nic James Ferrier
Brett Parker <[EMAIL PROTECTED]> writes: > On Fri, Jul 13, 2007 at 11:18:18AM +0100, Nic James Ferrier wrote: >> >> Derek Anderson <[EMAIL PROTECTED]> writes: >> >> > hey all, >> > >> > could anyone point me to a python html sanitizer implementation (or >> > example)? i don't mean to strip

Re: installation issues

2007-07-13 Thread Dirk van Oosterbosch, IR labs
On 13-jul-2007, at 5:42, surfwizz wrote: > I installed python from www.python.org, so the command prompt opens it > into 2.5.1. That's what I tried to install django into. Can you confirm that django is installed at this location?

Re: IN query fails (when params not used)

2007-07-13 Thread Malcolm Tredinnick
On Fri, 2007-07-13 at 10:07 +, jj wrote: > Why does the 1st query fail, whilst the 2nd succeeds, although the SQL > is identical? > > The 1st query indeed returns the error: "OperationalError: no such > column: 'FR'". Because you're not quoting the strings correctly. You need to wrap them

Re: select_related(), m2m, foreign(null=True)

2007-07-13 Thread Malcolm Tredinnick
On Fri, 2007-07-13 at 09:57 +, jj wrote: > I posted earlier about performance issues trying to display many books > in one single page. I've since fixed the problems by reducing the > number of SQL queries from 12 per book, to just 11 overall. I also > perform filtering based on user's

Re: html sanitizers

2007-07-13 Thread Brett Parker
On Fri, Jul 13, 2007 at 11:18:18AM +0100, Nic James Ferrier wrote: > > Derek Anderson <[EMAIL PROTECTED]> writes: > > > hey all, > > > > could anyone point me to a python html sanitizer implementation (or > > example)? i don't mean to strip all html, just tags and attributes not > > on a

Re: html sanitizers

2007-07-13 Thread Nic James Ferrier
Derek Anderson <[EMAIL PROTECTED]> writes: > hey all, > > could anyone point me to a python html sanitizer implementation (or > example)? i don't mean to strip all html, just tags and attributes not > on a whitelist, such as I/B/A href/U/etc. I use libxml2/libxslt, something like: doc =

IN query fails (when params not used)

2007-07-13 Thread jj
Why does the 1st query fail, whilst the 2nd succeeds, although the SQL is identical? The 1st query indeed returns the error: "OperationalError: no such column: 'FR'". query = """ SELECT book_foreign_print.book_id, book_foreign_print.date, book_foreign_print.country_id FROM book_foreign_print,

Re: html sanitizers

2007-07-13 Thread patrick k.
it´s easy to write a customized sanitizer using beautifulsoup. http://www.crummy.com/software/BeautifulSoup/ 1) place beautifulsoup.py somewhere in your pythonpath 2) build your sanitizer and save it somewhere on your pythonpath in my case it´s called eatMe and looks like this:

select_related(), m2m, foreign(null=True)

2007-07-13 Thread jj
I posted earlier about performance issues trying to display many books in one single page. I've since fixed the problems by reducing the number of SQL queries from 12 per book, to just 11 overall. I also perform filtering based on user's permissions up-front. Big performance boost. I ended

Re: Missing Plus-Sign over ManyToManyField

2007-07-13 Thread Manuel Meyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Yes, of course... THANKS!!! > > You need to add the Admin class to ContactPerson > > -rob > > On Jul 12, 6:59 am, Manuel Meyer <[EMAIL PROTECTED]> wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA256 >> >> Hey, >> >> from other projects,

RequestContext, user, cannot resolve keyword error

2007-07-13 Thread jj
I often get this error with the built-in server: Exception Type: TypeError Exception Value: Cannot resolve keyword 'user' into field Exception Location: C:\Python25\lib\site-packages\django\db\models \query.py in lookup_inner, line 939 (I query the RequestContext to obtain the

Re: Generating graphs from db data and displaying results using Django?

2007-07-13 Thread Frank Tegtmeyer
Toby Dylan Hocking <[EMAIL PROTECTED]> writes: > TimeSeries, etc. similar to XML/SWF Charts), but you can pop in your own > plotting code and have a totally custom plot too, if you need to. Such flexibility is great. I suggest to support "common" tasks too by providing an additional "simple"

Re: get_FOO_url() returns empty string

2007-07-13 Thread wolfds
Collin Grady schrieb: > You're missing the trailing slash on MEDIA_URL though, so get_img_url > won't get the proper path. Collin, that was my second fault, which came up after correcting my program as Jonathan described. Thank you, Wolf --~--~-~--~~~---~--~~

Re: get_FOO_url() returns empty string

2007-07-13 Thread wolfds
Jonathan Buchanan schrieb: > wolfds wrote: > > I ran into a problem which I tried to solve for several hours now. The > > situation is simple and straightforward: > > > > models.py: > > > > class Foo(models.Model) > > img = model.ImageField(upload_to='pix') > > > > settings.py: > > > >

html sanitizers

2007-07-13 Thread Derek Anderson
hey all, could anyone point me to a python html sanitizer implementation (or example)? i don't mean to strip all html, just tags and attributes not on a whitelist, such as I/B/A href/U/etc. danke, derek --~--~-~--~~~---~--~~ You received this message because

Re: Avoiding HTTP 301 code using mod_python

2007-07-13 Thread Chris Hoeppner
You might want to have a look at: http://www.djangoproject.com/documentation/settings/#append-slash Kind regards, Chris Hoeppner www.pixware.org Miguel Filho escribió: > Hello list, > > I'm deploying my site on webfaction.com using mod_python. URL: > http://interno.homelinux.org > > In

Re: Django + newforms + jQuery

2007-07-13 Thread Gary Doades
Przemek Gawronski wrote: > I want to show to the user a list of workorders with the possibility > to select one (probably I should use a radio button for that), above > the list are a couple of buttons that allow to display some extra > information for the selected workorder like a list of time

Re: Django + newforms + jQuery

2007-07-13 Thread Przemek Gawronski
> I have no idea what you're trying to do with your form, How about something like this: in my model I've got a class Workorder, with some info about it. For the Workorder there are time sheets, printouts and some other objects. I want to show to the user a list of workorders with the

confused about the order of the CacheMiddleware in MIDDLEWARE_CLASSES

2007-07-13 Thread Mesh007
Hi, all: I touch django not long before, and am learning it, when i touch the CacheMiddleware, i am confused confused about the order of the CacheMiddleware in MIDDLEWARE_CLASSES It is say: "Put the CacheMiddleware after any middlewares that might add something to the Vary header. " in the

Re: newforms does not create label's 'for' attribute

2007-07-13 Thread Malcolm Tredinnick
On Fri, 2007-07-13 at 05:56 +, Collin Grady wrote: > Sorry, guess it wasn't clear enough :) > > Without a "for" attribute, clicking on those labels fails to check the > box, which is fairly standard behavior, meaning you have to actually > click the box - I believe that's what he means by

Re: Django on a shared host. The docs are scaring me ;)

2007-07-13 Thread Collin Grady
One problem with fastcgi directions is that there is no "one method" - on some hosts, one method won't work, while another will. Most guides only mention one method or the other, so you're sort of left hanging unless you find the other method.