Moving Dictionary Entry to Core
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from beanie import Document
|
||||
from pydantic import Field, validator
|
||||
from pydantic import BaseModel, Field, validator
|
||||
|
||||
|
||||
class CrudDocument(Document):
|
||||
@@ -32,18 +32,25 @@ def text_area(*args, **kwargs):
|
||||
|
||||
|
||||
def RichtextMultiline(*args, **kwargs):
|
||||
kwargs['props'] = {
|
||||
"richtext": True,
|
||||
"multiline": True
|
||||
}
|
||||
if 'props' not in kwargs:
|
||||
kwargs['props'] = {}
|
||||
|
||||
kwargs['props']['richtext'] = True
|
||||
kwargs['props']['multiline'] = True
|
||||
|
||||
return Field(*args, **kwargs)
|
||||
|
||||
|
||||
def RichtextSingleline(*args, **kwargs):
|
||||
kwargs['props'] = {
|
||||
"richtext": True,
|
||||
"multiline": False
|
||||
}
|
||||
if 'props' not in kwargs:
|
||||
kwargs['props'] = {}
|
||||
|
||||
kwargs['props']['richtext'] = True
|
||||
kwargs['props']['multiline'] = False
|
||||
|
||||
return Field(*args, **kwargs)
|
||||
|
||||
|
||||
class DictionaryEntry(BaseModel):
|
||||
key: str
|
||||
value: str = ""
|
||||
|
||||
Reference in New Issue
Block a user