convert to modern MappedAsDataclass models
This commit is contained in:
@@ -2,9 +2,9 @@ import enum
|
||||
|
||||
import nanoid
|
||||
from nanoid_dictionary import human_alphabet
|
||||
from pyramid_sqlalchemy import BaseObject as _BaseObject
|
||||
from slugify import slugify
|
||||
from sqlalchemy import Column, String
|
||||
from sqlalchemy.orm import DeclarativeBase, MappedAsDataclass
|
||||
|
||||
|
||||
def genslug():
|
||||
@@ -19,7 +19,7 @@ class SlugMixin:
|
||||
return "-".join([self.slug, slugify(self.name.title().replace(" ", ""), ok="", only_ascii=True, lower=False)])
|
||||
|
||||
|
||||
class BaseObject(_BaseObject):
|
||||
class BaseObject(MappedAsDataclass, DeclarativeBase):
|
||||
"""
|
||||
Allows for iterating over Model objects' column names and values
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user