Merge branch 'trthhrtz-trthhrtz-issue-110-fix' into develop

This commit is contained in:
Itai Shirav 2019-02-26 21:41:16 +02:00
commit af3bdb3ff2
4 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,10 @@
Change Log
==========
Unreleased
----------
- Extend date field range (trthhrtz)
v1.0.4
------
- Added `timeout` parameter to database initializer (SUHAR1K)

View File

@ -9,7 +9,7 @@ Currently the following field types are supported:
| ------------------ | ---------- | ------------------- | -----------------------------------------------------
| StringField | String | unicode | Encoded as UTF-8 when written to ClickHouse
| FixedStringField | String | unicode | Encoded as UTF-8 when written to ClickHouse
| DateField | Date | datetime.date | Range 1970-01-01 to 2038-01-19
| DateField | Date | datetime.date | Range 1970-01-01 to 2105-12-31
| DateTimeField | DateTime | datetime.datetime | Minimal value is 1970-01-01 00:00:00; Always in UTC
| Int8Field | Int8 | int | Range -128 to 127
| Int16Field | Int16 | int | Range -32768 to 32767

View File

@ -89,7 +89,7 @@ When values are assigned to model fields, they are immediately converted to thei
>>> suzy.birthday = 0.5
ValueError: Invalid value for DateField - 0.5
>>> suzy.birthday = '1922-05-31'
ValueError: DateField out of range - 1922-05-31 is not between 1970-01-01 and 2038-01-19
ValueError: DateField out of range - 1922-05-31 is not between 1970-01-01 and 2105-12-31
Inserting to the Database
-------------------------

View File

@ -131,7 +131,7 @@ class FixedStringField(StringField):
class DateField(Field):
min_value = datetime.date(1970, 1, 1)
max_value = datetime.date(2038, 1, 19)
max_value = datetime.date(2105, 12, 31)
class_default = min_value
db_type = 'Date'