Reference
- class canaille.backends.models.Model[source]
Bases:
object
Model abstract class.
- attributes = ChainMap({})
- classmethod fuzzy(query, attributes=None, **kwargs)[source]
Works like
query()
but attribute values loosely be matched.
- classmethod get(identifier=None, **kwargs)[source]
Works like
query()
but return only one element orNone
if no item is matching.
- property identifier
Returns a unique value that will be used to identify the model instance. This value will be used in URLs in canaille, so it should be unique and short.
- classmethod query(**kwargs)[source]
Performs a query on the database and return a collection of instances. Parameters can be any valid attribute with the expected value:
>>> User.query(first_name="George")
If several arguments are passed, the methods only returns the model instances that return matches all the argument values:
>>> User.query(first_name="George", last_name="Abitbol")
If the argument value is a collection, the methods will return the models that matches any of the values:
>>> User.query(first_name=["George", "Jane"])
- class canaille.core.models.Group[source]
Bases:
object
User model, based on the SCIM Group schema
- class canaille.core.models.User(*args, **kwargs)[source]
Bases:
object
User model, based on the SCIM User schema
- check_password(password: str) bool [source]
Checks if the password matches the user password in the database.
- property preferred_email
- class canaille.oidc.basemodels.AuthorizationCode[source]
Bases:
Model
OpenID Connect temporary authorization code definition.
- class canaille.oidc.basemodels.Consent[source]
Bases:
Model
Long-term user consent to an application.