Re: Invalid block tag: 'current_time'

2008-04-04 Thread Evert Rol
> Hmmm, I understand > Put the {% load current_time%} in the template, but I do not know > why, is looking in the wrong place. > "django.templatetags.current_time," > > The right would be: > "myproject.myapp.templatetags.current_time" > > showing that error here: > TemplateSyntaxError at

Re: Apache & mod_python 404 error on page access

2008-04-03 Thread Evert Rol
> Okay, so whenever I request anything through my apache server I get a > 404 error. Here are my configuration files. > > Apache: > > DocumentRoot /home/chainsofheaven.net/html > ServerName chainsofheaven.net > ServerAlias *.chainsofheaven.net > > allow from all > Options +Indexes > > >

Re: relative link problem with admin login

2008-04-03 Thread Evert Rol
> I tried doing what you suggested, but now it gives me the error > 'RegexURLResolver' object has no attribute 'rindex' when I try to go > to the admin page (or any page that exists, for that matter. Pages > that don't exist get an unhandled exception). Can you show us your url setup as you have

Re: relative link problem with admin login

2008-04-02 Thread Evert Rol
> I'm trying to set up my site on a university webspace, so the root is > a subdirectory, ie www.university.edu/~mysite/. Because of this, I'm > having trouble logging into the admin pages. I go to > www.university.edu/~mysite/admin/ > and get the login page, but when I try to login, it goes to

Re: issue with the development server

2008-04-02 Thread Evert Rol
> I have a problem with the development server. I don't know if this > behavior is right or if there is a problem. > I have a view which is triggered throught an url. In this view I use > urllib2. If I start the view with the development server the process > is never ends. But if I start the view

Re: Django book error

2008-04-01 Thread Evert Rol
til the server's back up. > On Apr 1, 10:53 am, Evert Rol <[EMAIL PROTECTED]> wrote: >>> I am a newbie learning Django and so far loving the process. I'm >>> going >>> through the djangobook.com and came across a problem. >> >>> In chapter 5 you c

Re: Django book error

2008-04-01 Thread Evert Rol
> I am a newbie learning Django and so far loving the process. I'm going > through the djangobook.com and came across a problem. > > In chapter 5 you create your first database (how exciting!) problem is > it seem like everyone that went thought this chapter(including me) got > this error: > >

Re: Adding additional needed information in to newforms post

2008-04-01 Thread Evert Rol
> I thought that I could add in some additional information to a form > before it gets saved as a new object in the database but the following > isn't working: > > def groupadd(request): > >if request.method == 'POST': >form = GroupForm(request.POST) >if form.is_valid(): >

Re: Really strange Newforms issue with Initial data.

2008-04-01 Thread Evert Rol
> I just found a post where they do this .. > testform = BookingFormOne(initial={ > 'u_1stline': user.get_profile().currentAddress.street1, > } >) > as in call initial when the form class is called. and it seems to > work!?! > > can any one explain why thou? as i still dont get why

Re: Newbie with Django

2008-03-31 Thread Evert Rol
> I am a newbie with Django and was trying to get it work on windows > vista following the tutorial at > http://www.djangoproject.com/documentation/0.96/tutorial02/ > . > > After "activating the admin site" as suggested in the tutorial, I got > the following error > > > > Using the URLconf

Re: Calling syncdb twice

2008-03-31 Thread Evert Rol
> I was wondering why you can only call "python manage.py syncdb" to > create your databases but after that if you change your models file > it work create the changes and you have to do them manually using SQL? I think there are several threads in this discussion group that have some

Re: howto display table data in html?

2008-03-31 Thread Evert Rol
> I read there: > from django.shortcuts import render_to_response > from mysite.polls.model import Poll > def index(request): >latest_poll_list = Poll.objects.all() > > > What is 'latest_poll_list'? I assume it is a list, but a list of what? > Records? Can I cycle through that list (for X

Re: howto display table data in html?

2008-03-31 Thread Evert Rol
> Probably another stupid question (sigh), but looking at views.py and > having read just about all the documentation I could find (including > the Django book), I still do not see how I can get data from a > database into a web page. The Django book explains how it is done > using the live

Re: Optional else block in for

2008-03-31 Thread Evert Rol
Perhaps this is useful: http://www.djangosnippets.org/snippets/546/ It even has a ticket: http://code.djangoproject.com/ticket/6398 with, of course, ensuing discussion. > > I was looking at jinja[1] and there was one feature which I really > liked > "for loops have an optional else block

Re: many to many field problem

2008-03-31 Thread Evert Rol
> the transparency is inside class tableSlot, when i'm looping > tableSlot, it works fine... but when i add the columnsetup or > querysetup, i got the error.. maybe my query is wrong? :( Sorry, no idea so far, but there's probably still information lacking: > > >ds =

Re: localflavor in admin

2008-03-30 Thread Evert Rol
> I have a model: > > from django.db import models > from django import newforms as forms > from django.contrib.localflavor.us import forms as us_forms > > class Address(models.Model): > member = models.ForeignKey(Member, unique=True) > street =

Re: Admin page doesn't show calendar popup

2008-03-30 Thread Evert Rol
> I just installed Django 96.1 on my Mac. When I follow the tutorial > and get to the Admin page, the calendar pop ups don't show up. Is > there a problem with the install. I'm using Leopard. Could be your browser (javascript problem). What browser & version are you using; have you tried

Re: render_to_response syntax

2008-03-30 Thread Evert Rol
> render_to_response('template', *args, **kwargs): > kwargs looks like a dictionary but if I refer to a dictionary, it is > ignored: > > In >names = {} >names['my_name'] = "somename" >render_to_response('template.html', names) > > names is equivalent to {'my_name': 'somename'}, so I

Re: Shell reloading

2008-03-30 Thread Evert Rol
Have you tried installing iPython? I can remembers your history across sessions, and has lots of other niceties (eg, you can define a default set of import statements on startup). If installed, python manage.py shell will automatically pick it up. > Thanks Christian, that's a great tip! > >

Re: sys.path question

2008-03-29 Thread Evert Rol
> Path in Windows XP Home is: > D:\Phyton25\;D:\Python25Scripts;%SystemRoot%\system32;%SystemRoot%; > %SystemRoot%\System32\Wbem > > When I use the interpreter in PyScripter, I see: print sys.path > > ['C:\\Windows\\system32\\python25.zip', 'D:\\Python25\\Lib', 'D:\ > \Python25\\DLLs',

Re: many to many field problem

2008-03-29 Thread Evert Rol
tl in self.tableList.all(): > tl.setting.lastUpdate = datetime.now() > tl.setting.save() > > class Meta: > verbose_name = ('Query Setup') > > class Admin: > fields = ( > ('Query Setup', { > 'fields' : (('sqlQ

Re: many to many field problem

2008-03-29 Thread Evert Rol
> ds = DigitalSignage.objects.get(pk=ds_id) > #Digital Signage config & setting > setting = ds.setting > textslots = ds.textslot_set.all() > slots = ds.slot_set.all() > tableslots = tableSlot.objects.filter(DS_List=ds) > columnsetups =

Re: Tutorial: Admin Template Customization

2008-03-28 Thread Evert Rol
> directory. Also, when I run locate base_site.html from within the > shell, it only returns the default base_site.html located in the > django/contrib/admin/templates/admin/ directory. When I cd into locate uses a database which doesn't always get promptly updated. Waiting a few hours (or

Re: usernames and case sensitivity

2008-03-28 Thread Evert Rol
> You've understood me perfectly. I was just being picky. I would > *like* to preserve the option of cased usernames, but if wikimedia > doesn't fuss with it, why should I? I'll just add a clean_username > method to the registration form that .lower() 's the name entered as > suggested. >

Re: usernames and case sensitivity

2008-03-28 Thread Evert Rol
>>> 2) Validate new usernames for case-insensitive uniqueness and filter >>> with case-insensitive queries whenever the username is URL param. > >> def view(request, username, child=None, ...): >> username = username.lower() > > The problem here is that that even if 'Charlie' and 'charlie'

Re: Cannot run Django on my local machine

2008-03-28 Thread Evert Rol
Looks like you have a cookie in the webbrowser on your desktop, for the localhost domain (have you been trying to run a wiki-page there?). Try clearing that cookie, then reload/restart the dev-server. > I've already run Django on my Laptop (OpenSuse 10.3) and it was so > easy thanks to

Re: usernames and case sensitivity

2008-03-28 Thread Evert Rol
> I am writing an application that involves a number of nested parent- > child relationships, where users create objects that each in turn have > sub-objects. So far the URL structure looks like this: > > example.com/username/ > example.com/username/child1/, example.com/username/child2/ >

Re: many to many field problem

2008-03-28 Thread Evert Rol
> thanks for reply, but i don't quite understand :( sorry i'm newbie > here > First my models.py is like this > class DigitalSignage(models.Model): > DS_ID = integerField() > > class tableSlot(models.Model): > ds_id =models.ManyToManyField(DigitalSignage) > > class

Re: many to many field problem

2008-03-28 Thread Evert Rol
> hi all, needs help here. i declare this in views.py > >ds = DigitalSignage.objects.get(pk=ds_id) >setting = ds.setting >textslots = ds.textslot_set.all() >slots = ds.slot_set.all() >tableslots = ds.tableslot_set.all() >columnsetups =

Re: Problems with Apache + mod_python

2008-03-27 Thread Evert Rol
> If your python interpreter can't import django, you installed it > wrong. > C'est tres facil. One of the previous post in this thread mentions the development server works fine, so django can be imported from the shell apparently. But testing that will never hurt; there may happen to be

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
>> Thanks, Evert! I could check now that the table is correct - and, >> with >> some experimenting, I found the mistake I had made too: I had, in >> models.py, in class Admin, entered "ordering = ('nummer')" instead of >> "ordering = ['nummer']". >> >> Perhaps somebody can explain why

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> Thanks, Evert! I could check now that the table is correct - and, with > some experimenting, I found the mistake I had made too: I had, in > models.py, in class Admin, entered "ordering = ('nummer')" instead of > "ordering = ['nummer']". > > Perhaps somebody can explain why list_display and

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> I don't mean to be overly critical, its not a bad application, but > if its marketed to 'perfectionists' then I guess you have to expect > people to be demanding =) Yup. But in their defence: the software comes completely free, and does work mostly out of the box. Anyway, perhaps this

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> I deleted the database again - run syncdb again - clicked 'Change' and > bingo: same error message! No date entered, this time. Only this one > table in the database... Is this typical for sqlite? I've never experienced anything like this with sqlite. What does your model look like; there may

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> I guess by "bug" I meant that > > synchronizing, by its nature involves making two disparate things > congruent. > > syncdb does not do that. Well, it does, up to the part that 'it' (the writers) feels confident about: it synchronizes the database globally with newly added models; indeed

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> I got this error when I added a field to my models, ran sycndb. > > I believe I got this error because syncdb failed to actually add the > correct column to the database to reflect the changes I had made to > my models. > > I believe this is a bug in syncdb, but maybe someone more >

Re: Trouble running dev server after upgrade to Leopard.

2008-03-27 Thread Evert Rol
> EDIT: After writing all of the stuff below, I got it working, at least > somewhat. I usually used sudo to run the dev server because I wanted > to run it on port 80 (nevermind why, long explanation). Doing that > still produces the same error, but if I run it without the sudo, it > works. I

Re: Trouble running dev server after upgrade to Leopard.

2008-03-26 Thread Evert Rol
> I recently upgraded from OS X Tiger to 10.5 Leopard. I've been trying > for the last two days to get my Django development setup working > again. There seems to be a row of pitfalls involved in this but I > think I've gotten at least a part of the way. Apple did change several settings re:

Re: tutorial __str__() method not working

2008-03-26 Thread Evert Rol
> I'm just going through the mysite tutorial and can't seem to get the > __str__() method to work when adding it to the two classes, I still > get []. > > polls/models.py: > > from django.db import models > import datetime > > class Poll(models.Model): >question =

Re: ImportError: No module named urls

2008-03-25 Thread Evert Rol
> I am just starting out with django (and python). I have already worked > through the tutorial successfully; now I am going through it again > adapting the examples to suit the web app I want to build (a local > book sharing scheme). What I have done so far is to define the models, > create the

Re: Saving Posted form data to database

2008-03-25 Thread Evert Rol
> I am having a bit of trouble posting checked items from a form to my > view so I can save it to a database table. > The data in the form are information that has been stripped from a > file so there is no database link/referencing there. > > What I have done half works as it does post my

Re: MySQL-python-1.2.2 errors

2008-03-25 Thread Evert Rol
You might be better off asking here: https://sourceforge.net/forum/forum.php?forum_id=70461 > I'm trying to build MySQL-python-1.2.2 and I don't understand how to > fix these errors: > > running build > running build_py > copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb >

Re: Using mod in if in template

2008-03-24 Thread Evert Rol
On 24 Mar 2008, at 19:29 , Tim Sawyer wrote: >> The second thing to do is to read the template documentation to see >> what is available, because doing so will turn up things like this: >> >> http://www.djangoproject.com/documentation/templates/#divisibleby > > I saw that, but I couldn't work

Re: A Python question

2008-03-24 Thread Evert Rol
> This is more a Python issue than a Django one, but I thought the > Python-aware people that you are might be able to help me :) > > I would like to do something like: > > def called(arg) >if arg==True: >!!magic!!caller.return 1 > > def caller(arg) >called(arg) >return 2 > >

Re: Error running: python manage.py sqlall 'myapp'

2008-03-08 Thread Evert Rol
> File > "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ > site-packages/django/db/backends/mysql/introspection.py", > line 1, in >from django.db.backends.mysql_old.base import DatabaseOperations > ImportError: No module named mysql_old.base > > > I'm using Python 2.5.1

Re: please help ForeignKey('Class')

2008-03-08 Thread Evert Rol
> thanks that did work! > > I did have max_length but it didn't like it > > must update django?? No, probably not yet then. I'm just using 0.97pre, where the warning showed up. Probably doesn't in 0.96, but keep it in mind in case you do update. (Unless of course you're still at 0.95.)

Re: please help ForeignKey('Class')

2008-03-08 Thread Evert Rol
> Hi there > I am having a problem with ForeignKey(Class) in my models.py > if the Class it comes before the class then it says I should put it in > quotes. > > ForeignKey('Class') > > put when i run python manage.py validate to check its ok it doesn't > like it You didn't give the error from

Re: URLConf/ManytoManyField issue (exercise problem from Teach Yourself Django in 24 Hour)

2008-03-08 Thread Evert Rol
> I am going Django (liking it so far), and I seem to hit a wall with > one of the exercises. It likely because of my unfamiliarity with > Python, so bear with me, please. > > At the end of Hour 6, I got two exercises to do: > > 1. Create an additional view for the People object that displays

Re: IDE

2008-03-07 Thread Evert Rol
>> So far many editors/IDEs have been put on the table here, let me >> remind you: > > Free as in freedom: > * OpenKomodo > * UliPad > * PIDA > * Eric > * Boa Constructor > * Eclipse + Pydev > * Kate > * Geany > * SPE > * Vim > * PyPE > > Non-free: > * Komodo > * Textmate (mac only) > * Coda

Re: 0.96 custom django login problem

2008-03-06 Thread Evert Rol
> I am new to django, and I am trying to create a custom login > application, from where the users might get access to other > applications in the system. I can not get it to work, please, I need > help. Well, what exactly isn't working? That may give people a better start on where to look

Re: Optimizing code for a query

2008-03-05 Thread Evert Rol
> I need to optimize some code related to django db api. > Imagine a model like this: >> > class Languages( models.Model ): > name = models.CharField( max_length=255 ) > ... >> > class Object ( models.Model ): > name = models.CharField( max_length=255 ) >

Re: Optimizing code for a query

2008-03-05 Thread Evert Rol
>>> I need to optimize some code related to django db api. >>> Imagine a model like this: >> >>> class Languages( models.Model ): >>> name = models.CharField( max_length=255 ) >>> ... >> >>> class Object ( models.Model ): >>> name = models.CharField( max_length=255 ) >>> languages =

Re: location of CSS

2008-03-04 Thread Evert Rol
> I can't figure out where to put css files or background images > referred to by > css. I have: > > > and > MEDIA_ROOT = '/home/phil/philproj/media/' Don't you need a '/media/' or something before that 'dirview.css'? What is your MEDIA_URL? Since Django normally has the media files (css,

Re: Problems using cron to run a python script

2008-03-04 Thread Evert Rol
stion is how do I add this >> path in the cron, especially since the script runs from the command >> line? >> >> On Mar 4, 9:02 am, Evert Rol <[EMAIL PROTECTED]> wrote: >> >>>> Well part of the problem is that the script itself works fine. I >&

Re: Adding ManyToManyField to Django models

2008-03-04 Thread Evert Rol
> I was wondering if it's possible to add a ManyToManyField onto a > prebuilt Django model such as User... I know that it would look like > this if I were to have created the model myself: > class User(models.Model): > watch = models.ManyToManyField('self', null=True, blank=True) > > I'm

Re: Problems using cron to run a python script

2008-03-04 Thread Evert Rol
> OK, I did what you instructed and checked the log file, which did > contain the system path and the traceback about the "can't import > module...". Your script did run (you thought it completely failed), but -only- up the 'import feedparser' part. Anything before that ('print sys.path')

Re: Problems using cron to run a python script

2008-03-04 Thread Evert Rol
> Well part of the problem is that the script itself works fine. I can > run from the command line without a hitch. But when I try to run it > via the cron, I get the traceback about the feedparser module. I believe that, because your PYTHONPATH will be set correctly from the command line; but

Re: Problems using cron to run a python script

2008-03-04 Thread Evert Rol
> I'm not sure where to print the path. Do I add that to the > update_feeds.py? Or does this go in the cron itself? > > If I add it to the script, and then run the script from the command > line, it prints what's on my python path and then runs the script as > normal. > > But that's never been

Re: Problems using cron to run a python script

2008-03-04 Thread Evert Rol
> Unfortunately, I get the same traceback: > > Traceback (most recent call last): > File "update_feeds.py", line 10, in ? > import feedparser > ImportError: No module named feedparser Again: did you print the sys.path? The 'cd' is not going to work, unless your modules are relative to the

Re: Problems using cron to run a python script

2008-03-04 Thread Evert Rol
> No, I haven't tried that. How would I go about citing that? Top of script (possibly just below the she-bang): import sys print sys.path >>> Traceback (most recent call last): >>> File "/path/to/script/update_feeds.py", line 10, in ? >>> import feedparser >>> ImportError: No module named

Re: Problems using cron to run a python script

2008-03-04 Thread Evert Rol
> > Traceback (most recent call last): > File "/path/to/script/update_feeds.py", line 10, in ? > import feedparser > ImportError: No module named feedparser > > And here is the cron: > > export PYTHONPATH=/path/to/python2.3/site-packages:/path/to/django/app > export

Re: Optimizing code for a query

2008-03-04 Thread Evert Rol
> I need to optimize some code related to django db api. > Imagine a model like this: > > class Languages( models.Model ): >name = models.CharField( max_length=255 ) >... > > class Object ( models.Model ): >name = models.CharField( max_length=255 ) >languages =

Re: HttpResponseRedirect not redirecting

2008-03-03 Thread Evert Rol
> > > # urls.py > > urlpatterns = patterns('', >(r'^addorder/', add_order), >(r'^addorder/results/', results), > ) Not 100% sure, but try adding a $ at the end of your regexes, to indicate there's nothing after the url. Django now finds the r'^addorder/' also for the url

Re: How to display a date in my template as Mar. 1 2008...not 2008-03-01?

2008-03-02 Thread Evert Rol
> Daniel, > Now i'm getting the error: > > Could not parse the remainder: ' "jS o\f F"' from 'a.date|date "jS o\f > F"' >> It's a variable, not a tag, so use {{ a.date|date "jS o\f F" }} - ie >> {{ }}, rather than {% %}. > Shouldn't there be a colon between the filter and its arguments: {{

Re: django under xampp under windows

2008-03-02 Thread Evert Rol
> I put this in my urls file: > > (r'^site_media/(?P.*)$', 'django.views.static.serve', > {'document_root': 'C:\django\Django-0.96.1\django\contrib\admin > \media'}), > > but the program still can't find the dashboard: > > Check your ADMIN_MEDIA_PREFIX in your settings.py file, and make

Re: Evaluating/stepping through sliced QuerySets

2008-02-21 Thread Evert Rol
> There is a threaded comments app http://code.google.com/p/django- > threadedcomments/ > , Now that I think about it, they surely would be doing this > conversion from relational to hierarchical format. I will read the > code and let you know if I can find something useful. While I had been

Re: self referential manytomany

2008-02-21 Thread Evert Rol
> That would be true if I defined both models in the same models.py, and > Profile was trying to use Bookmark before it was loaded in the file. > Because this is an import the quotes won't work. That being said this > in one model works when I don't need to put a import statement in it. > So: > >

Re: Converting relational data to hiechical data

2008-02-21 Thread Evert Rol
> I have a model like > > class Task(models.Model): > name = Models.CharField(max_length = 100) > parent = models.ForeignKey('Task', null = True) > > Using this model say I have got a table like, > > Task > --- > ID Name Parent_id > 1 Foo null > 2 Bar 1 > 3 Baz1 > 4

Re: self referential manytomany

2008-02-21 Thread Evert Rol
On 21 Feb 2008, at 16:44 , Michael Newman wrote: > > I am a bit confused as to why it is that this gives me an error. I > hope someone could explain it to me. > > Let's say I have users with Profiles that can be connected to the one > Web page that they can author. The other Users can bookmark