Core_sessions table

2007-01-26 Thread Pythoni
Can anyone explain what is core_sessions table for? I noticed that it is the largest table (and growing and growing) from all may tables in my project. Is it possible to stop it becoming larger and larger? --~--~-~--~~~---~--~~ You received this message because

models, composite primary keys

2007-01-26 Thread Michel Thadeu Sabchuk
Hi guys, Does anyone worked on some way to django models work with composite primary keys? I need to implement a login system and the login should be unique for an specified username and a specified site url. I see the ticket above and it seems the wasn't any advance after it.

Large scale Django deployment - advice needed

2007-01-26 Thread J
The Star Tribune is considering changing our default development environment from Java/PHP to Django. This could be as small as developing database applications like the Washington Post and as large as developing all technology (CMS, templating, registration, etc) for startribune.com. I am

textarea - autoamtic line break

2007-01-26 Thread [EMAIL PROTECTED]
Hi, i have a fixed textarea, rows and cols are defined. if the user write a text and run out of a line without a break, it should set a new line. But a new line is only set if the user press line break. i test following: css {white-space:pre} but this dont't help, is there a possibillity to

Initial data for a Select widget in newforms

2007-01-26 Thread Denis Frère
Hi all, I'm discovering newforms. It works pretty well, but I can't manage to give an initial selection in a ChoiceField (Select widget). I tried to read the code. I understand I have to give a "value" parameter to Select.render(), but how do I pass that value in the form initial data

Filter problem

2007-01-26 Thread mtnpaul
I wrote a small function as follows from models import MyModel def simple_contain( MyModelA , clean_dictionary, my_field_name) my_filter_field= my_field_name + '__contains' x = MyModelA.objects.filter(my_filter_field = form_data[my_field_name] return x . k =

Re: Generic Views - problem with template missing

2007-01-26 Thread Panos Laganakos
I've added the allow_future option, and indeed it worked. Thanks alot! Though, not sure what "in the future" means. a matter of the date not being the same in the db and the server or something? Care to explain? On Jan 26, 1:08 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 1/20/07, Panos

newforms and custom errors / adding one's own errors to newform forms

2007-01-26 Thread Larmes
Is there a simple way to add my own error messages to a newform object so that I don't have to pass extra stuff to template context and .as_table() takes care of displaying the error for me? That is, can anyone point out the utter stupidity of doing stuff like: form = SomeForm(post_data) if

Re: reload(module) not working

2007-01-26 Thread Manish Singh
You are probably right. It's too much hacky. I ended up reading the script and executing using 'exec' What I am trying to do is keep independent stand alone scripts which does something useful. However when copied into a particular directory location under on application(django web app), the

Re: No module named MIMEText

2007-01-26 Thread Russell Keith-Magee
On 1/27/07, johnny <[EMAIL PROTECTED]> wrote: > > I just deleted those .pyc files. How do I compile it? I thought > python is interpreted language. It is, but the code is compiled into a bytecode format (pyc) as an optimization step that removes the need to parse the source code every time it

Re: No module named MIMEText

2007-01-26 Thread johnny
I just deleted those .pyc files. How do I compile it? I thought python is interpreted language. On Jan 23, 8:03 am, "mojo" <[EMAIL PROTECTED]> wrote: > I had this problem once. > > Don't know the cause of it, but deleting and recompilation .pyc files in > Python24\Lib\email\ helped. > >

Re: Newbie Django Error

2007-01-26 Thread James Bennett
On 1/26/07, AC <[EMAIL PROTECTED]> wrote: > What would cause the following error when trying the href="http://www.djangobook.com/en/beta/chapter03/;>Chapter 3 > example? The book works with Django trunk -- a Suversion checkout of the code -- and not the latest official release (I believe this

Re: Newbie Django Error

2007-01-26 Thread [EMAIL PROTECTED]
Post your urls On Jan 26, 3:19 pm, "AC" <[EMAIL PROTECTED]> wrote: > What would cause the following error when trying the href="http://www.djangobook.com/en/beta/chapter03/;>Chapter 3 > example? > > Traceback (most recent call last): > File >

Newbie Django Error

2007-01-26 Thread AC
What would cause the following error when trying the http://www.djangobook.com/en/beta/chapter03/;>Chapter 3 example? Traceback (most recent call last): File "C:\Python24\lib\site-packages\django-0.95.1-py2.4.egg\django\core\handlers\base.py" in get_response 65. callback, callback_args,

Re: reload(module) not working

2007-01-26 Thread Jeremy Dunck
On 1/26/07, Manish Singh <[EMAIL PROTECTED]> wrote: > I have this sample snippet, which works find when run from command line Unless I misunderstand how Python handles imports, they're added to sys.modules, a dict, and keyed by the module name. You're repeatedly importing modules named "parse"

Re: reload(module) not working

2007-01-26 Thread Manish Singh
Currently I am still in development and using built in webserver. On Jan 26, 9:13 pm, "mtnpaul" <[EMAIL PROTECTED]> wrote: > I believe that reload requires a fairly new version of mod_py in > apache2. Which version are you running? > > On Jan 26, 7:57 am, "Manish Singh" <[EMAIL PROTECTED]>

Help with Last Seen (why doesn't this work???)

2007-01-26 Thread [EMAIL PROTECTED]
I have a middleware solution that's supposed to figure out the last time the visitor was seen (should be familiar to folks that have looked at the zyons code): class LastSeen (object): """Middleware that adds various objects to thread local storage from the request object.""" def

Re: reload(module) not working

2007-01-26 Thread mtnpaul
I believe that reload requires a fairly new version of mod_py in apache2. Which version are you running? On Jan 26, 7:57 am, "Manish Singh" <[EMAIL PROTECTED]> wrote: > Hi, > > I have this sample snippet, which works find when run from command line > > def

newbie - subclassing newforms.Form

2007-01-26 Thread david-oz
Reading the newforms.forms says that you should subclass from BaseForm rather than Form. Have got this working by changing by changing newforms.forms.py __all__ to ('BaseForm', 'Form', 'DeclarativeFieldsMetaclass') to allow: class NewForm( forms.BaseForm ): def __init__(self, arg=None):

Re: OT: DFW Python and the real Django

2007-01-26 Thread Jeremy Dunck
On 1/26/07, Tim Chase <[EMAIL PROTECTED]> wrote: > or google for > > "django reinhardt festival" (ft-worth OR fort-worth) More useful results: http://music.dallasobserver.com/search/locations.php?oid=7214 http://www.pegasusnews.com/events/2007/jan/26/23646/

Re: Simple next and previous index in templates

2007-01-26 Thread [EMAIL PROTECTED]
For what it's worth, I'd suggest getting your javascript out of those links, for graceful degradation: In your javascript, loop through the links, get the href, and use it to know which ones to show and hide. {% for item in site_details.Photos.all %} {{item}}

OT: DFW Python and the real Django

2007-01-26 Thread Tim Chase
As Django got its name from Django Reinhardt, I thought I'd mention for fans. Not only is PyCon being held in Dallas, TX, but this weekend there's a Django Reinhardt festival in Ft. Worth just a short distance (by Texas standards...about 20-30 minutes) from Dallas. So if you're a local

Re: newbie strange behavior

2007-01-26 Thread James Bennett
On 1/26/07, Brian Rosner <[EMAIL PROTECTED]> wrote: > Ah, that does make sense. Yeah I am running with a production server, > but using a virtual host to contain out the production site from > development. I suppose I can just build another Apache and strip it > down for my development needs.

Re: newbie strange behavior

2007-01-26 Thread Brian Rosner
Ah, that does make sense. Yeah I am running with a production server, but using a virtual host to contain out the production site from development. I suppose I can just build another Apache and strip it down for my development needs. Thanks for the tip. On Jan 26, 11:11 am, "Waylan Limberg"

Re: newbie strange behavior

2007-01-26 Thread Waylan Limberg
On 1/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I am new to Python web development, but not web development in general. > I have installed mod_python 3.2.10 alongside my currently running > Apache 2.0.59. All is working fine, but one thing. I am currently > building a Django

Re: update col=col+1

2007-01-26 Thread Wolfram Kriesing
so there is no one query solution, ok. thx On 1/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > object = Model.objects.get(pk=x) > object.col += 1 > object.save() > > On Jan 26, 11:54 am, "Wolfram Kriesing" <[EMAIL PROTECTED]> > wrote: > > I know I had read it here a while ago, but I

Re: Simple next and previous index in templates

2007-01-26 Thread nesh
* AndyB wrote, On 26.01.2007 16:56: > here's what I've got: > > {% for item in site_details.Photos.all %} > > {{item}} > > {% if not forloop.first %} > prev {{ forloop.counter|add:"-1" }} > {% endif %} > {% if not forloop.last

newbie strange behavior

2007-01-26 Thread [EMAIL PROTECTED]
I am new to Python web development, but not web development in general. I have installed mod_python 3.2.10 alongside my currently running Apache 2.0.59. All is working fine, but one thing. I am currently building a Django application and I have no problems making it. However, I'll edit a file

Re: update col=col+1

2007-01-26 Thread [EMAIL PROTECTED]
object = Model.objects.get(pk=x) object.col += 1 object.save() On Jan 26, 11:54 am, "Wolfram Kriesing" <[EMAIL PROTECTED]> wrote: > I know I had read it here a while ago, but I cant find it. > So what was the ORM way of doing a > UPDATE table SET col=col+1 > ? > > -- > thx > > Wolfram

"cannot import" error when doing an import of an app's models

2007-01-26 Thread Phil Powell
This is a very odd one: I have a number of apps installed, and I'm updating models.py in one of them to import the models of another, like this: from mysite.myapp1.models import MyModel Nothing unusual about that, huh? Except now if I run manage.py validate, I get errors like this:

Re: Sites crashing after moving to 4431

2007-01-26 Thread Adrian Holovaty
On 1/26/07, Ramdas S <[EMAIL PROTECTED]> wrote: > I moved my Django SVN version on my PC to 4431 about 20 minutes back. > Following this all my Django web apps are crashing when I run python > manage.py runserver. > > Any ideas? > > I am not able to test anything on my PC. I use Ubuntu 6.06 and

update col=col+1

2007-01-26 Thread Wolfram Kriesing
I know I had read it here a while ago, but I cant find it. So what was the ORM way of doing a UPDATE table SET col=col+1 ? -- thx Wolfram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

validation in newforms

2007-01-26 Thread django_user
I am using newforms for user registration module. How do I check if username isAlphaNumeric ? Where do I use validator_list? class UserProfileForm(forms.Form): username = forms.CharField(max_length=30) password1 = forms.CharField(widget=PasswordInput) ... ... .. ... ... . ...

Simple next and previous index in templates

2007-01-26 Thread AndyB
I'm trying to have a list of images in a doc all hidden in css with next and prev links that unhide and hide to give the appearence of scrolling through. I'm struggling with the Django template system. I know this is putting logic into templates rather than views but it seems odd to move simple

Re: Sites crashing after moving to 4431

2007-01-26 Thread Ramdas S
What Adam suggested did not work! I just moved back to per-objects-permissions trunk and things are working for now. Thanks Ramdas On 1/26/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > > On 1/26/07, Ramdas S <[EMAIL PROTECTED]> wrote: > > > > Any ideas? > ... > > File > >

Re: define odd, even in a loop

2007-01-26 Thread [EMAIL PROTECTED]
You could use divisibleby (http://www.djangoproject.com/documentation/templates/#divisibleby) {% if forloop.counter|divisibleby:2 %} Even {% else %} Odd {% endif %} On Jan 26, 10:49 am, "Rob Slotboom" <[EMAIL PROTECTED]> wrote: > {% ifequal forloop.counter 1 %}odd{% endifequal %} > {%

Re: Sites crashing after moving to 4431

2007-01-26 Thread Jeremy Dunck
On 1/26/07, Ramdas S <[EMAIL PROTECTED]> wrote: > > Any ideas? ... > File > "/usr/lib/python2.4/site-packages/django/newforms/__init__.py", > line 15, in ? > from fields import * > File > "/usr/lib/python2.4/site-packages/django/newforms/fields.py", > line 18 > <<< .mine That's

Re: define odd, even in a loop

2007-01-26 Thread Benedict Verheyen
Rob Slotboom schreef: > {% ifequal forloop.counter 1 %}odd{% endifequal %} > {% ifequal forloop.counter 3 %}odd{% endifequal %} > {% ifequal forloop.counter 5 %}odd{% endifequal %} > > Is there a way to calculate this kind of thing, something like: > {% ifodd forloop.counter %}I am very odd{%

define odd, even in a loop

2007-01-26 Thread Rob Slotboom
{% ifequal forloop.counter 1 %}odd{% endifequal %} {% ifequal forloop.counter 3 %}odd{% endifequal %} {% ifequal forloop.counter 5 %}odd{% endifequal %} Is there a way to calculate this kind of thing, something like: {% ifodd forloop.counter %}I am very odd{% endifodd %}

Re: Sites crashing after moving to 4431

2007-01-26 Thread Adam Fast
I was having the same problem, rolling back to 4429 fixed it for me. svn update -r 4429 (IIRC, that was last night) Adam On 1/26/07, Ramdas S <[EMAIL PROTECTED]> wrote: > > I moved my Django SVN version on my PC to 4431 about 20 minutes back. > Following this all my Django web apps are crashing

Generic Authorization vs per-object-permissions branch

2007-01-26 Thread Ramdas S
Hi, I am working on something where I need to provide object level permissions or column level permissions at least. There are two branches which I see being **inactively**. being developed. 1) Per-object-permissions which I feel is stable enough though I have not tried nothing really

Sites crashing after moving to 4431

2007-01-26 Thread Ramdas S
I moved my Django SVN version on my PC to 4431 about 20 minutes back. Following this all my Django web apps are crashing when I run python manage.py runserver. Any ideas? I am not able to test anything on my PC. I use Ubuntu 6.06 and Python 2.4.3. My guess this is a bug This is the error.

use url parameter or session var?

2007-01-26 Thread Benedict Verheyen
Hi, in a previous thread i posted about a problem that i had with explorer not keeping track of HTTP_REFERER. I needed this since i wanted to return to a certain page the user came from. I then changed my code so it works on Firefox & Explorer: try: page =

reload(module) not working

2007-01-26 Thread Manish Singh
Hi, I have this sample snippet, which works find when run from command line def walk_and_execute_all_parse_modules(dir): collection = [] for root, dirs, files in os.walk(dir): collection.append( (root, files) ) import parse rootdir = sys.path[0] wkdir = os.getcwd()

Re: View didn't return an HttpResponse

2007-01-26 Thread [EMAIL PROTECTED]
Thanks Zak... I figured that out, but it's always good to know I figured something out right. On Jan 25, 4:35 pm, Zak Johnson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > It looks like it's because (as you said), I'm returning a string, in > > the exception... so how do I do that? >

Re: having trouble with templates recognizing locations of css files

2007-01-26 Thread chasfs
The problem is in django/core/servers/basehttp.py - in class AdminMediaHandler. It hardcodes self.media_dir = django.__path__[0] + '/contrib/admin/media' and ignores MEDIA_ROOT. On Jan 19, 5:19 pm, "rsie" <[EMAIL PROTECTED]> wrote: > I'm not sure what to do to get my templates to resolve the

Re: order_by not working with foreign keys:

2007-01-26 Thread Bram - Smartelectronix
Michael Radziej wrote: > Please report your results in the ticket, I'd appreciate! Done. - bram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Euro Sign raise UnicodeEncodeError

2007-01-26 Thread Michael Radziej
Hi, we have a bit of chaos here ... Tickets 3370, 1356 and probably 952 all are about this problem, all are accepted, and #3370 and #1356 have very similar patches. I ask everybody to continue discussion in django-developers ("unicode issues in multiple tickets"), and I ask the authors of these

Re: many2many with newforms

2007-01-26 Thread nesh
* Benoit Chesneau wrote, On 25.01.2007 17:45: > Hi, > > I have a models with a many2many field. I try to use it with > MultiChoiceField in newforms to.? But it doesn't work. I hve this Take a look at http://trac.studioquattro.biz/djangoutils/browser/branches/0.1/forms (especially to

Re: easy way of rerouting print messages

2007-01-26 Thread Graham Dumpleton
On Jan 25, 11:57 pm, "Benedict Verheyen" <[EMAIL PROTECTED]> wrote: > Hi, > > when i used the builtin web server, i did my debugging via print messages. > Now that the site has gone into production, i use Apache and so the > print messages > don't show up anymore. > Is there an easy way to

Re: Euro Sign raise UnicodeEncodeError

2007-01-26 Thread Ivan Sagalaev
Christian Schmidt wrote: > Do I have to encode (or decode) the string before I put it into the > database First, it depends on database backend. As far as I know MySQL wants byte strings (and for example psycopg2 lives happily with unicode strings). If you use newforms then you have data in

Re: easy way of rerouting print messages

2007-01-26 Thread Benedict Verheyen
Benedict Verheyen schreef: > Jeremy Dunck schreef: >>> Or i should be doing this in the settings file and importing this in my >>> files. But then again, i use utility classes and then those would have >>> to import settings to be able to use the same logfile. That doesn't feel >>> right. >>