When I attempt to use a datetime I run into issues with validation:
plugins.py
import typing
from datetime import datetime
from gilbert.content import Templated, Content
class BuzzwordSummary(Templated, Content):
term: str
posted: datetime = datetime.now()
template: str = "buzzword.html"
Example page:
content_type: BuzzwordSummary
term: low hanging fruit
---
A way of describing a task that's easy to do
This results in the following traceback:
File "/Users/janis/BuzzwordsGlossary/buzzwords_glossary/plugins.py", line 6, in <module>
class BuzzwordSummary(Templated, Content):
File "/Users/janis/BuzzwordsGlossary/venv/lib/python3.7/site-packages/gilbert/schema.py", line 149, in __new__
_type = validator_for(_type)
File "/Users/janis/BuzzwordsGlossary/venv/lib/python3.7/site-packages/gilbert/schema.py", line 101, in validator_for
raise TypeError(f"How do I validate a {_type !r} ?")
TypeError: How do I validate a <class 'datetime.datetime'> ?
When I attempt to use a datetime I run into issues with validation:
plugins.py
Example page:
This results in the following traceback:
How would we go about validating these?