Hi Lloyd,
In your urls.py file, you want to specify the view as a string -
you're currently missing the quotes around it. It should look like
this:
urlpatterns = patterns(",
(r'^time/$' , 'current_datetime'), # <-- quotes added!
)
The (not particularly helpful) message you're getting is
Not sure if SmileyChris is this guy, but I've had good success with
this project:
http://www.aswmc.com/dbmigration/
I use it (with postgres) and it works just fine for me. It would be
nice if it was a bit more "pythonic", but it definitely gets the job
done.
On Nov 25, 6:43 pm, "Russell Keith-
How about this:
import random
Book.objects.all()[random.randint(0,Book.objects.count()-1]
On Nov 9, 2:00 pm, Hani <[EMAIL PROTECTED]> wrote:
> Hi James,
>
> I did go through the API documentation but did not find what I wanted.
> Please note that I am both a Django and Python newbie so its lik
Hi Greg,
Within the view you can just use python's built in round function
>>> round(92.5698,2)
92.57
The full documentation is here:
http://docs.python.org/lib/built-in-funcs.html
Look for the "round()" function - the second argument is the number of
decimal places you wish to retain.
Hope
You might want to check this out:
http://www.aswmc.com/dbmigration/
--~--~-~--~~~---~--~~
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 unsub
5 matches
Mail list logo