nest_backend
- Core module¶.gestione
- Utility methods¶Gestione adds many fancy thingamajigs to the flask application, such as a login system and such.
+nest_backend.gestione.
authenticate
(username, password)¶Authentication method. It checks if the combination of username+password is a valid match. If not, it returns None. +:param username: the user’s email +:param password: the user’s password +:return: if the credentials are correct, it returns the user. Else, it returns None.
+nest_backend.gestione.
identity
(payload)¶Authentication verification method. It checks if the user is in fact registered on the server. +It is required by Flask-JWT, and shouldnt be used alone. +:param payload: the reqest payload. +:return: an User or None. It depends whether the user is actually registered on the platform.
+nest_backend.gestione.
gen_password
(password)¶It generates an hashed password. +:param password: the password that needs to be hashed. +:return: the password’s hash.
+nest_backend.gestione.
find_user
(email)¶nest_backend.gestione.
admin_or_403
(f)¶nest_backend.gestione.
repository_auth
(f)¶nest_backend.gestione.
json_error
(msg)¶Returns an error in json format +:param msg: the error message. +:return: a json formatted string.
+nest_backend.gestione.
json_success
(data)¶An happy little function. Its happy because the operation was successful. +:param data: the thing you want to be returned +:return: a json formatted string
+nest_backend.gestione.
error_handler
(e)¶.database
- Database¶This module imports all the tables and the declarative base
+.base
- Flask extension¶.tables
- Database tables¶This module contains all database classes.
+nest_backend.database.tables.
Alert
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
id
¶name
¶limit
¶window_size
¶repository_id
¶repository
¶notifications
¶operations
¶to_json
()¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+nest_backend.database.tables.
Authorization
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
rid
¶email
¶repository
¶user
¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+nest_backend.database.tables.
BoolOperation
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
id
¶operation
¶isRoot
¶condition_id
¶node_1_id
¶node_2_id
¶alert_id
¶condition
¶node_1
¶node_2
¶alert
¶to_json
()¶get_chain_ids
(l)¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+father_1
¶father_2
¶nest_backend.database.tables.
Composed
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
rid
¶snowflake
¶repository
¶tweet
¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+nest_backend.database.tables.
Condition
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
id
¶type
¶content
¶repository_id
¶repository
¶tweets
¶operations
¶to_json
()¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+nest_backend.database.tables.
Contains
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
cid
¶snowflake
¶condition
¶tweet
¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+nest_backend.database.tables.
Notification
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
id
¶ora
¶alert_id
¶alert
¶to_json
()¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+nest_backend.database.tables.
Repository
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
id
¶name
¶start
¶end
¶is_active
¶evaluation_mode
¶owner_id
¶owner
¶tweets
¶alerts
¶conditions
¶to_json
()¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+nest_backend.database.tables.
Tweet
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
snowflake
¶content
¶location
¶poster
¶repositories
¶conditions
¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+nest_backend.database.tables.
User
(**kwargs)¶Bases: sqlalchemy.orm.decl_api.Model
email
¶username
¶password
¶isAdmin
¶owner_of
¶to_json
()¶__init__
(**kwargs)¶A simple constructor that allows initialization from kwargs.
+Sets attributes on the constructed instance using the names and
+values in kwargs
.
Only keys that are present as +attributes of the instance’s class are allowed. These could be, +for example, any mapped columns or relationships.
+.routes
- API routes¶