got an unexpected keyword argument 'max_digits'

2007-09-24 Thread [EMAIL PROTECTED]
i have a model with : score = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True) when i issue: python manage.py syncdb in command line, got this error: D:\djangopro\mysite>python manage.py syncdb Error: One or more models did not validate: mysite.places:

Some New User Questions & Suggestions

2007-09-24 Thread staff-gmail
somehow my earlier post got stuck into another thread. As a new user, here are some suggestions & questions: Startup: It is important to note in the documentation that with some distros (ie ubuntu) you need: $ django-admin.py startproject myproject then to create an application: $ cd myproject

Re: Strange error, trying to deploy Django with mod_wsgi

2007-09-24 Thread Graham Dumpleton
On Sep 25, 3:26 pm, Steve Potter <[EMAIL PROTECTED]> wrote: > On Sep 24, 6:16 pm, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > > > > Are you sure that the user Apache is running as has permissions > > > to read directories/files under the missed user's home dir?. > > > The permissions issu

Data truncated for column 'text' at row 1

2007-09-24 Thread Sebastian Dahlgren
Hi! I have built my site on the Django dev server and everything works fine there. But when I uploaded the project to a Apache + mod_python server I got an error Data truncated for column 'text' at row 1 That is shown when I pass swedish chars like å ä and ö into a form, which then POST's the fo

Data truncated for column 'text' at row 1

2007-09-24 Thread Sebastian Dahlgren
Hi! I have built my site on the Django dev server and everything works fine there. But when I uploaded the project to a Apache + mod_python server I got an error Data truncated for column 'text' at row 1 That is shown when I pass swedish chars like å ä and ö into a form, which then POST's the fo

Re: Strange error, trying to deploy Django with mod_wsgi

2007-09-24 Thread Steve Potter
On Sep 24, 6:16 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > > > Are you sure that the user Apache is running as has permissions > > to read directories/files under the missed user's home dir?. > > The permissions issues along with other common issues are described > in: > > http://code.go

Two newform best practice questions

2007-09-24 Thread Cat
Hello I'm starting out with newforms and although I have found a lot of examples using form_for_instance I haven't found enough on custom forms to answer (at least for me) the following questions: 1) What is best practice to populate a custom form with instance data? 2) What is the recommended

Re: dictionary access in templates

2007-09-24 Thread Kenneth Gonsalves
On 25-Sep-07, at 10:23 AM, Oleg Korsak wrote: > Hello! I have many `tour` objects as a key for a `tour_dict` > dictionary. > How can I access tour_dict values using tour? Like tour_dict[tour]... > template will not work with [ ] how about tour_dict.tour? -- regards kg http://lawgon.livejou

dictionary access in templates

2007-09-24 Thread Oleg Korsak
Hello! I have many `tour` objects as a key for a `tour_dict` dictionary. How can I access tour_dict values using tour? Like tour_dict[tour]... template will not work with [ ] signature.asc Description: OpenPGP digital signature

How would I construct this query using Django?

2007-09-24 Thread Michael
Hey everyone, For my question I'll reference this model: class Event(models.Model): description = models.CharField(max_length=200) event_date = models.DateTimeField() def __unicode__(self): return self.description So basically I've got a bunch of events and when they take

Re: Confusion with the reverse resolver

2007-09-24 Thread josePhoenix
(I think) I solved this by updating my copy of django. It was getting a bit stale :| On Sep 24, 10:38 pm, [EMAIL PROTECTED] wrote: > I'm getting a NoReverseMatch error, when as far as I can tell, > everything is as it should be with view functions and urlconfigs. The > traceback probably tells it

menuse

2007-09-24 Thread Alvaro Mouriño
Hi List, I've just developed a (very simple) app to create menus with links to flatpages or URIs and I'd like to share it with you. From http://code.google.com/p/django-menuse/ This app lets you create and administer menus from flatpages in 5 easy steps: 1. Create your flatpages. 2. Crea

Confusion with the reverse resolver

2007-09-24 Thread josePhoenix
I'm getting a NoReverseMatch error, when as far as I can tell, everything is as it should be with view functions and urlconfigs. The traceback probably tells it better than me (this dpaste also includes the view it's supposed to find a reverse match for, the urlconfig for that app, and the view wh

Re: guid's in python

2007-09-24 Thread Leo Shklovskii
I've been able to dig into this a little bit more and it looks like django.utils.simplejson.decoder doesn't support the '\x' escape character. Is this an intentional omission, a bug in Django, or just me misunderstanding Python? -- --Leo Leo Shklovskii wrote: > Hi, > > I'm trying to represen

Newforms validation question

2007-09-24 Thread r_f_d
I have an app that uses a roll-my-own role-based access system to restrict access to various model instances. Essentially what happens is that there is a role or roles assigned to users that allow them to either view or edit various asset types based on the owning organization. Many of the asset

Re: Strange error, trying to deploy Django with mod_wsgi

2007-09-24 Thread Graham Dumpleton
On Sep 25, 8:44 am, "Ramiro Morales" <[EMAIL PROTECTED]> wrote: > On 9/24/07, Steve Potter <[EMAIL PROTECTED]> wrote: > > > [...] > > But when I > > tried to load the site I still received a 500 error and the apache > > error log had the following: > > > mod_wsgi (pid=5070): Exception occurred wit

Making Django Easier For New Users

2007-09-24 Thread staff-gmail
Just some perspectives from a new user starting to use Django from Rails and PHP. I really like the organization of Django (great job guys). But due to some of the newness, here are some lack of examples that still make Django kind of hard to use or figure out. So while my comments might so

strange set/dict problem

2007-09-24 Thread Oleg Korsak
Hello. I have such code: tour_paginator = ObjectPaginator(Tour.objects.extra(where=['tours_country.id=tours_tour.country_id'], tables=['tours_country']).order_by('tours_country.name'), 20) tours = tour_paginator.get_page(page - 1) then in tours I have such set: [, , , , ] then I'm doing this: f

Re: Strange error, trying to deploy Django with mod_wsgi

2007-09-24 Thread Ramiro Morales
On 9/24/07, Steve Potter <[EMAIL PROTECTED]> wrote: > [...] > But when I > tried to load the site I still received a 500 error and the apache > error log had the following: > > mod_wsgi (pid=5070): Exception occurred within WSGI script '/home/ > missed/projectsmt/pjsmt.wsgi'. > [...] > OSError: [

Re: custom sql ?

2007-09-24 Thread Richard Dahl
I should pay better attention, try: Tours.objects.all().order_by('country') -richard On 9/24/07, Oleg Korsak <[EMAIL PROTECTED] > wrote: > > Error in formatting: отсутствует запись о FROM-выражении для таблицы > "tours_country" LINE 1: ..."tours_tour"."user_id" FROM "tours_tour" > ORDER BY "tours_

GoFlow: a workflow engine for django, available now as a django contrib

2007-09-24 Thread MiloZ
You can here dowload the workflow engine contrib; a demo django project is included http://django-goflow-en.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Strange error, trying to deploy Django with mod_wsgi

2007-09-24 Thread Steve Potter
I am in the process of trying to deploy a Django site using mod_wsgi. I had no problems installing mod_wsgi. However I did run into a few problems when trying to set the site. The first thing I ran into is that i forgot to install Mysql-python. So, I downloaded the source and did the following:

Re: custom sql ?

2007-09-24 Thread Oleg Korsak
Error in formatting: отсутствует запись о FROM-выражении для таблицы "tours_country" LINE 1: ..."tours_tour"."user_id" FROM "tours_tour" ORDER BY "tours_cou... ^ It says that there is no tours_country in FROM statement... Richard Dahl пишет: > Am I missing something or wouldn't > Tours.objects.al

Re: custom sql ?

2007-09-24 Thread Richard Dahl
Am I missing something or wouldn't Tours.objects.all().order_by('tours_country.name') work? -richard On 9/24/07, Oleg Korsak <[EMAIL PROTECTED]> wrote: > > Hello! I have such models: > > class Country(models.Model): > name = models.CharField(_('name'), maxlength=32) > > def __unic

custom sql ?

2007-09-24 Thread Oleg Korsak
Hello! I have such models: class Country(models.Model): name = models.CharField(_('name'), maxlength=32) def __unicode__(self): return self.name class Meta: verbose_name = _('country') verbose_name_plural = _('countr

Re: elsif in templates?

2007-09-24 Thread Giuseppe Ciotta
Well, I assume an "elif" should not be considered "advanced logic", but basic branching functionality, as "if" and "else" are. Not allowing such functionality leaves space for ugly and unreadable code nesting. On 9/24/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > On 9/24/07, Giuseppe Ciotta <[E

Re: QuerySet filters. Making both sides of the comparison parametric

2007-09-24 Thread AndyB
Lovely. I'd never seen the function(**{expression}) syntax before. For anyone else in the same boat the rather terse official explanation is here: http://docs.python.org/ref/calls.html (search the page for '**expression') Tim Chase wrote: > > if (search_query['organisation']!=""): > >

guid's in python

2007-09-24 Thread Leo Shklovskii
Hi, I'm trying to represent an Active Directory's user guid in Django. In AD, its a 128 bit integer that I can pull out with using the ldap library. When I access the guid, python treats it as a string with most of the characters escaped, so something like: "\xdd3\x9e0\xd9\xf4\x93B\x90\xdehDe

Re: Union/join of two queryset?

2007-09-24 Thread jake elliott
hi francesco cesco wrote: > I have two QuerySets and I need to join them to pass them as first > parameter to the ObjectPaginator class. > How can I do that? > The "+" operator doesn't work (like it does for lists) and there is no > a method like the list one "extend()". you can use the bitwise

Re: QuerySet filters. Making both sides of the comparison parametric

2007-09-24 Thread Tim Chase
> if (search_query['organisation']!=""): > jobs = jobs.filter(organisation=search_query['organisation']) > if (search_query['region']!=""): > jobs = jobs.filter(region=search_query['region']) > if (search_query['category']!=""): > jobs = jobs.filter(category=sea

Union/join of two queryset?

2007-09-24 Thread cesco
Hi, I have two QuerySets and I need to join them to pass them as first parameter to the ObjectPaginator class. How can I do that? The "+" operator doesn't work (like it does for lists) and there is no a method like the list one "extend()". Any suggestion would be very appreciated. Best regards

Re: Design a model for a Blog

2007-09-24 Thread Alex Koshelev
No, you must set unique=True argument manual for slug field On 24 сент, 23:39, Florian Lindner <[EMAIL PROTECTED]> wrote: > Am Sonntag, 23. September 2007 schrieb Alex Koshelev: > > > Slug is very good when you want to create "fine" urls. You can convert > > (using prepopulate_from param) your ti

Re: Design a model for a Blog

2007-09-24 Thread Florian Lindner
Am Sonntag, 23. September 2007 schrieb Alex Koshelev: > Slug is very good when you want to create "fine" urls. You can convert > (using prepopulate_from param) your title field of entry to slug and > use it for entry's permalink. > But of course you can use entry's id(integer value) for url mappin

cPickle dumps UnicodeDecodeError

2007-09-24 Thread [EMAIL PROTECTED]
I'm trying to use Pickle to take a rather large dictionary object and pass it via URL to a small python utility outside of my Django application... however when I attempt to construct the URL in my template, I keep getting the following error: 'utf8' codec can't decode byte 0x80 in position 1878:

QuerySet filters. Making both sides of the comparison parametric

2007-09-24 Thread AndyB
So if I've got code like this: if (search_query['organisation']!=""): jobs = jobs.filter(organisation=search_query['organisation']) if (search_query['region']!=""): jobs = jobs.filter(region=search_query['region']) if (search_query['category']!=""): jobs = jobs

Re: File uploading problems

2007-09-24 Thread jacoberg2
Hey thanks for your help, but i may need a little more. I dont really know anything about apache and without a good background everything i look up is just confusing me. i changed the file system permissions to allow "everyone" to write in the bulk file which is where i have the files directed. An

Re: MEDIA_URL

2007-09-24 Thread jacoberg2
Hey Michael, > Not sure exactly what you mean by getting the right url - it should > point somewhere external to django - ie. a separate webserver - > there's no magic there. If you've got apache running on your > development machine, then this can just > behttp://localhost/mydjangoprojectmedia

Using a Single Sign-on Server with Django

2007-09-24 Thread Nimrod A. Abing
Hello, Does anyone know of a single sign-on server that can be used with Django? Similar to the approach taken by Cosign or Pubcookie but without the fluff that is LDAP and Kerberos. Just a simple database of users and passwords to authenticate again

Re: passing user id from current session to model

2007-09-24 Thread heru
wow, thanks richard, django-python project makes me in the middle of nowhere i'm from indonesia with small bandwidth, no local django community, small and slow local python community on mailing-list...damn hell!! thanks for help -heru- new kid on django On Sep 25, 12:09 am, "Richard Dahl" <[EMA

Django and memcached

2007-09-24 Thread Nianbig
Hi I´m trying to get memcached up and running with Django. I have added the following to my settings.py: CACHE_BACKEND = 'memcached://127.0.0.1:11211/' CACHE_MIDDLEWARE_SECONDS = 10 CACHE_MIDDLEWARE_KEY_PREFIX = 'testsite' And my middleware classes looks like this: MIDDLEWARE_CLASSES = (

Sessions not storing anything

2007-09-24 Thread Johannes Dahlström
Hi guys, I'm having a strange problem with sessions not storing anything that I haven't encountered before. For example, the simple test below outputs "Worked?: False" even though the headers seem to show cookies working quite nicely. The admin interface also outputs a message saying that cookies

Re: passing user id from current session to model

2007-09-24 Thread Richard Dahl
Take a look at: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser -richard On 9/24/07, heru <[EMAIL PROTECTED]> wrote: > > > Hi, > i'm new in django and python as well. > i'm trying to create a model for my article > > from django.db import models > from django.contrib.auth.models im

passing user id from current session to model

2007-09-24 Thread heru
Hi, i'm new in django and python as well. i'm trying to create a model for my article from django.db import models from django.contrib.auth.models import User class Article(models.Model): title = models.CharField(maxlength=32) content = models.TextField() publish = models.DateTimeField()

BlogRush: a best way to increase your blog traffic

2007-09-24 Thread harry
Join here: http://www.blogrush.com/r18502062 --~--~-~--~~~---~--~~ 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, s

Re: Does anyone have an easy way to debug the values in a session?

2007-09-24 Thread Bert Heymans
Thanks David, I'm going to do that, good tip. For the record, the KeyError I got came from trying to loop over request.session directly instead of over request.session.items Cheers, Bert On Sep 24, 5:56 pm, David Reynolds <[EMAIL PROTECTED]> wrote: > On 24 Sep 2007, at 4:36 pm, Bert Heymans w

Re: Does anyone have an easy way to debug the values in a session?

2007-09-24 Thread David Reynolds
On 24 Sep 2007, at 4:36 pm, Bert Heymans wrote: > > Hi, > > I'm kind of stuck, the documentation says that request.session should > be used like a dictionary but if I use a for-loop in a template an try > to loop over a session like this "for key, value in session" just like > I would access ite

Does anyone have an easy way to debug the values in a session?

2007-09-24 Thread Bert Heymans
Hi, I'm kind of stuck, the documentation says that request.session should be used like a dictionary but if I use a for-loop in a template an try to loop over a session like this "for key, value in session" just like I would access items in an ordinary dictionary, I always get a KeyError and can't

Re: elsif in templates?

2007-09-24 Thread Jeremy Dunck
On 9/24/07, Giuseppe Ciotta <[EMAIL PROTECTED]> wrote: > > Is there a real reason behind this or just this is to be implemented > in the future? http://www.djangoproject.com/documentation/design_philosophies/#template-system --~--~-~--~~~---~--~~ You received this

FileField representation in admin

2007-09-24 Thread A. Reppel
It would be nice to have FileField shown in the admin interface with a link to the uploaded file. Is there a way to do it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: how to implement "stay logged on this computer until i log out"?

2007-09-24 Thread Mark Green
Hi Joe, thx for the pointer, looks workable. Will try it soon. -moe On Sun, 2007-09-23 at 23:08 -0700, Joseph Heck wrote: > You can certainly access cookies manually and do with them as you > like. That's how we've implemented a "remember who it was that last > logged in from this computer" kin

Re: ordering for many-to-many fields: random?

2007-09-24 Thread patrickk
anyone? On 22 Sep., 17:30, patrickk <[EMAIL PROTECTED]> wrote: > I never thought about this before, but displaying the results of a > many-to-many relationship on a website seems to be ordered by random. > > Lets´s say I´m having a movie and I´m assigning countries with m2m. > The movie is a co-p

Re: elsif in templates?

2007-09-24 Thread Giuseppe Ciotta
Is there a real reason behind this or just this is to be implemented in the future? On 9/24/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 9/24/07, A. Reppel <[EMAIL PROTECTED]> wrote: > > does the template language have a elsif clause for if and if{not}equal? > > No, just nest {% if %}, {%

Re: elsif in templates?

2007-09-24 Thread jake elliott
hi a. A. Reppel wrote: > does the template language have a elsif clause for if and if{not}equal? nope, you'll have to go with {% if %} {% else %} {% if %} {% endif %} {% else %} {% endif %} best, jake --~--~-~--~~~---~--~~ You received this message becaus

Tips for Windows

2007-09-24 Thread John Travolta
Tweak your Windows XP http://windowsfreetips.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 django-users@googlegroups.com To unsubscribe from t

Re: elsif in templates?

2007-09-24 Thread James Bennett
On 9/24/07, A. Reppel <[EMAIL PROTECTED]> wrote: > does the template language have a elsif clause for if and if{not}equal? No, just nest {% if %}, {% ifequal %}, etc., like so: {% if foo %} {{ foo }} {% else %} {% if bar %} {{ bar }} {% endif %} {% endif %} -- "Bureaucrat

Windows XP, Python 2.5, Django ,mod_python, Apache2.0,FastCGI, SCGI, flup, eunuchs

2007-09-24 Thread Thomas
I have to install Django for a project and i have to install FastCGI for testing a application on my computer. I have install Python 2.5, Django ,mod_python, Apache2.0. For FastCGI and SCGI i have install flup and i get flup http://trac.saddi.com/flup, there stand i have to install eunuchs if i h

elsif in templates?

2007-09-24 Thread A. Reppel
does the template language have a elsif clause for if and if{not}equal? --~--~-~--~~~---~--~~ 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 unsu

Re: TinyMCE in admin

2007-09-24 Thread Kenneth Gonsalves
On 24-Sep-07, at 2:32 PM, AniNair wrote: > Hi... > Can someone please tell me how to use TinyMce in admin for editing > flat pages? did you check out the list archives - it is all explained there -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~

Re: TinyMCE in admin

2007-09-24 Thread Kenneth Gonsalves
On 24-Sep-07, at 3:44 PM, AniNair wrote: > I installed TinyMCE as mentioned in > http://www.dehora.net/journal/2006/05/ > using_tinymce_in_djangos_admin.html > I am trying according to the doc > http://code.djangoproject.com/wiki/ > AddWYSIWYGEditor#UsingTinyMCEwithflatpages > Any ideas? so w

Re: TinyMCE in admin

2007-09-24 Thread AniNair
I installed TinyMCE as mentioned in http://www.dehora.net/journal/2006/05/using_tinymce_in_djangos_admin.html I am trying according to the doc http://code.djangoproject.com/wiki/AddWYSIWYGEditor#UsingTinyMCEwithflatpages Any ideas? --~--~-~--~~~---~--~~ You receiv

Mac OS X 10.4 + Python 2.4.3 + Django + Apache2 + mod_python

2007-09-24 Thread Leo
I just went through getting set up for testing my Django apps under mod_python as well as the test server. For the sake any other users trying to sort through this on Mac OS X, I thought I'd post what finally worked for me (YMMV). I assume you have a Django app working under the test server, and

Re: admin media

2007-09-24 Thread Anurag
Thanks so much! Anurag On Sep 24, 1:39 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > On 9/24/07, Anurag <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > Sorry for this repeat post - but i am getting desperate and > > seeking some quick kindly help. > > > I am unable to get my admin me

TinyMCE in admin

2007-09-24 Thread AniNair
Hi... Can someone please tell me how to use TinyMce in admin for editing flat pages? --~--~-~--~~~---~--~~ 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@google

Re: Cannot connect to database

2007-09-24 Thread Bert Heymans
You could give http://www.instantdjango.com/ a try, maybe snoop around a little in the installation to see how they set things up, just to learn from. I helped a colleague on a Windows Xp set up Django last week, instantdjango works well but it has it's own python interpreter that comes with the

Re: The setlang view

2007-09-24 Thread Aidas Bendoraitis
Or you can have a form with an for each language. Regards, Aidas Bendoraitis [aka Archatas] On 9/24/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Sun, 2007-09-23 at 18:13 +0100, Chris Hoeppner wrote: > [...] > > Seems pretty silly to me. I know that any request "having some kind of >

Re: admin media

2007-09-24 Thread Jonathan Buchanan
On 9/24/07, Anurag <[EMAIL PROTECTED]> wrote: > > Hi, > Sorry for this repeat post - but i am getting desperate and > seeking some quick kindly help. > > I am unable to get my admin media to be served by Apache. I am runinng > on windows. > > Here is my httpd.conf > > > SetHandler python-

admin media

2007-09-24 Thread Anurag
Hi, Sorry for this repeat post - but i am getting desperate and seeking some quick kindly help. I am unable to get my admin media to be served by Apache. I am runinng on windows. Here is my httpd.conf SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv