Re: Django... False promises?

2008-01-03 Thread LorenDavie
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

Re: Preferred Schema Evolution Tool

2007-11-25 Thread LorenDavie
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

Re: pull a random record from the database

2007-11-09 Thread LorenDavie
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

Re: How to convert 92.5698 to 92.57

2007-10-15 Thread LorenDavie
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

Re: Any way to re-synch database when I change models.py without deleting the DB?

2007-08-24 Thread LorenDavie
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