Skip to content
Browse files

Updated docstrings, spelling fixes

  • Loading branch information...
1 parent c929664 commit 84a0ab4abbd94e9af2cb4a359b41898fc5c334fc @mfogel committed Jun 2, 2012
Showing with 7 additions and 4 deletions.
  1. +6 −4 timezone_field/fields.py
  2. +1 −0 timezone_field/models.py
View
10 timezone_field/fields.py
@@ -13,24 +13,26 @@ class TimeZoneField(models.Field):
Valid inputs:
* any instance of pytz.tzinfo.DstTzInfo or pytz.tzinfo.StaticTzInfo
+ * the pytz.UTC singleton
* any string that validates against pytz.all_timezones. pytz will
be used to build a timezone object from the string.
* None and the empty string both represent 'no timezone'
Valid outputs:
* None
* instances of pytz.tzinfo.DstTzInfo and pytz.tzinfo.StaticTzInfo
+ * the pytz.UTC signleton
Note that blank values ('' and None) are stored as an empty string
- in the db. Specifiying null=True makes your db column not have a NOT
+ in the db. Specifying null=True makes your db column not have a NOT
NULL constraint, but from the perspective of this field, has no effect.
If you choose to add validators at runtime, they need to accept
pytz.tzinfo.DstTzInfo and pytz.tzinfo.StaticTzInfo objects as input.
If you choose to override the 'choices' kwarg argument, and you specify
choices that can't be consumed by pytz.timezone(unicode(YOUR_NEW_CHOICE)),
- wierdness will ensue. Don't do this. It's okay to further limit CHOICES,
+ weirdness will ensue. Don't do this. It's okay to further limit CHOICES,
but not expand it.
"""
@@ -59,7 +61,7 @@ def validate(self, value, model_instance):
def to_python(self, value):
"Convert to pytz timezone object"
- # inspriation from django's Datetime field
+ # inspiration from django's Datetime field
if value is None or value == '':
return None
if isinstance(value, pytz.tzinfo.BaseTzInfo) or isinstance(value, type(pytz.utc)):
@@ -73,7 +75,7 @@ def to_python(self, value):
def get_prep_value(self, value):
"Convert to string describing a valid pytz timezone object"
- # inspriation from django's Datetime field
+ # inspiration from django's Datetime field
value = self.to_python(value)
if value is None:
return ''
View
1 timezone_field/models.py
@@ -0,0 +1 @@
+# intentionally left blank

0 comments on commit 84a0ab4

Please sign in to comment.
Something went wrong with that request. Please try again.