Model level constraint
Fields have `null=False` by default, or in other words, by default fields do not allow null values. @coleifer thanks for take the time to answer Peewee beginners questions. You are doing a very good job here 👏

one more ... 

I create a SQLite db and a model with a DateField, say:
```
class MyModel(BaseModel):
  n1 = IntegerField(unique=True)
  date1 = DateField(unique=True)
```
Then the model is populate from a json file:
```
   with open('json.jl') as f:
      for line in f.readlines()
         data = MyModel(**json.loads(line))
         data.save()
```
The above code is running fine, UNIQUE constraints raise exceptions has expected. 
But I put, intentionally, wrong values on `date1` field like '2017-1-59' or 'any string'  and the values get store without `Exception`. I thought that `DateField` enforce some constraint or validation. 

What I miss here??
   You should be passing them in as Python `datetime.date` objects rather than as strings. `DateField` only set the field type on table creation, but don´t do validation beyond null check or unique constraints? 
 It's more complicated than that, unfortunately.

SQLite doesn't have a true date/time data-type. Databases like MySQL or Postgres would raise an error if you tried to insert garbage data, but with SQLite you need to either represent the date-time as a string (in which case you should use YYYY-mm-dd HH:MM:SS to ensure lexicographic sorting) or an integer timestamp.

If you want to enforce validation, you can subclass DateTimeField (or DateField or whatever) and modify the `db_value()` method to ensure strings are valid dates (or datetimes or whatever). @coleifer now is clear to me. Thanks a lot for the details in the explanation.

I take your advice and convert date str to `datetime.date` before save it.


A incomer here ...
I know the field constraints but I need `null=False` for all fields.

Can I set `null=False` by default for a Model, Is this possible?



 