bump version, update docs
This commit is contained in:
18
docs_src/models/docs014.py
Normal file
18
docs_src/models/docs014.py
Normal file
@ -0,0 +1,18 @@
|
||||
import databases
|
||||
import sqlalchemy
|
||||
|
||||
import ormar
|
||||
|
||||
database = databases.Database("sqlite:///db.sqlite")
|
||||
metadata = sqlalchemy.MetaData()
|
||||
|
||||
|
||||
class Course(ormar.Model):
|
||||
class Meta:
|
||||
database = database
|
||||
metadata = metadata
|
||||
|
||||
id: int = ormar.Integer(primary_key=True)
|
||||
name: str = ormar.String(max_length=100)
|
||||
completed: bool = ormar.Boolean(default=False)
|
||||
non_db_field: str = ormar.String(max_length=100, pydantic_only=True)
|
||||
23
docs_src/models/docs015.py
Normal file
23
docs_src/models/docs015.py
Normal file
@ -0,0 +1,23 @@
|
||||
import databases
|
||||
import sqlalchemy
|
||||
|
||||
import ormar
|
||||
from ormar import property_field
|
||||
|
||||
database = databases.Database("sqlite:///db.sqlite")
|
||||
metadata = sqlalchemy.MetaData()
|
||||
|
||||
|
||||
class Course(ormar.Model):
|
||||
class Meta:
|
||||
database = database
|
||||
metadata = metadata
|
||||
|
||||
id: int = ormar.Integer(primary_key=True)
|
||||
name: str = ormar.String(max_length=100)
|
||||
completed: bool = ormar.Boolean(default=False)
|
||||
|
||||
@property_field
|
||||
def prefixed_name(self):
|
||||
return 'custom_prefix__' + self.name
|
||||
|
||||
Reference in New Issue
Block a user