Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated docstrings, spelling fixes

  • Loading branch information...
commit 84a0ab4abbd94e9af2cb4a359b41898fc5c334fc 1 parent c929664
Mike Fogel authored

Showing 2 changed files with 7 additions and 4 deletions. Show diff stats Hide diff stats

  1. +6 4 timezone_field/fields.py
  2. +1 0  timezone_field/models.py
10 timezone_field/fields.py
@@ -13,6 +13,7 @@ class TimeZoneField(models.Field):
13 13
14 14 Valid inputs:
15 15 * any instance of pytz.tzinfo.DstTzInfo or pytz.tzinfo.StaticTzInfo
  16 + * the pytz.UTC singleton
16 17 * any string that validates against pytz.all_timezones. pytz will
17 18 be used to build a timezone object from the string.
18 19 * None and the empty string both represent 'no timezone'
@@ -20,9 +21,10 @@ class TimeZoneField(models.Field):
20 21 Valid outputs:
21 22 * None
22 23 * instances of pytz.tzinfo.DstTzInfo and pytz.tzinfo.StaticTzInfo
  24 + * the pytz.UTC signleton
23 25
24 26 Note that blank values ('' and None) are stored as an empty string
25   - in the db. Specifiying null=True makes your db column not have a NOT
  27 + in the db. Specifying null=True makes your db column not have a NOT
26 28 NULL constraint, but from the perspective of this field, has no effect.
27 29
28 30 If you choose to add validators at runtime, they need to accept
@@ -30,7 +32,7 @@ class TimeZoneField(models.Field):
30 32
31 33 If you choose to override the 'choices' kwarg argument, and you specify
32 34 choices that can't be consumed by pytz.timezone(unicode(YOUR_NEW_CHOICE)),
33   - wierdness will ensue. Don't do this. It's okay to further limit CHOICES,
  35 + weirdness will ensue. Don't do this. It's okay to further limit CHOICES,
34 36 but not expand it.
35 37 """
36 38
@@ -59,7 +61,7 @@ def validate(self, value, model_instance):
59 61
60 62 def to_python(self, value):
61 63 "Convert to pytz timezone object"
62   - # inspriation from django's Datetime field
  64 + # inspiration from django's Datetime field
63 65 if value is None or value == '':
64 66 return None
65 67 if isinstance(value, pytz.tzinfo.BaseTzInfo) or isinstance(value, type(pytz.utc)):
@@ -73,7 +75,7 @@ def to_python(self, value):
73 75
74 76 def get_prep_value(self, value):
75 77 "Convert to string describing a valid pytz timezone object"
76   - # inspriation from django's Datetime field
  78 + # inspiration from django's Datetime field
77 79 value = self.to_python(value)
78 80 if value is None:
79 81 return ''
1  timezone_field/models.py
... ... @@ -0,0 +1 @@
  1 +# intentionally left blank

0 comments on commit 84a0ab4

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