Committin a 'working' checkpoint before I break more stuff.

This commit is contained in:
Greg Taylor 2008-06-15 19:06:31 +00:00
parent ccf078b5c8
commit d3808c1ea2
18 changed files with 494 additions and 444 deletions

View file

@ -0,0 +1,19 @@
"""
Utility functions for the Object class. These functions should not import
any models or modify the database.
"""
def is_dbref(dbstring):
"""
Is the input a well-formed dbref number?
"""
try:
number = int(dbstring[1:])
except ValueError:
return False
if not dbstring.startswith("#"):
return False
elif number < 1:
return False
else:
return True