Fix: Login.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Module Initialisation
|
||||
Feature: Business Objects
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: Base Business Object
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: Base Business Object
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: Database Base Business Objects
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: SQL Error Business Object
|
||||
@@ -23,6 +23,7 @@ from datetime import datetime, timedelta
|
||||
import locale
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from sqlalchemy import Uuid
|
||||
from sqlalchemy.types import Integer
|
||||
from typing import ClassVar
|
||||
|
||||
# db = SQLAlchemy()
|
||||
@@ -126,22 +127,22 @@ class Parameters_SQL_Error(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def get_default(cls, guid):
|
||||
return cls(
|
||||
guid = guid
|
||||
guid = guid
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
guid = json.get('a_guid', None)
|
||||
guid = json.get('a_guid', None)
|
||||
)
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_guid': self.guid
|
||||
'a_guid': self.guid
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_guid': Uuid
|
||||
'a_guid': Uuid
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: MTG Deck Business Object
|
||||
@@ -17,7 +17,7 @@ from helpers.helper_app import Helper_App
|
||||
# external
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
from sqlalchemy.types import Text, Boolean
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
|
||||
|
||||
class MTG_Deck(SQLAlchemy_ABC, Base):
|
||||
@@ -108,36 +108,40 @@ class MTG_Deck(SQLAlchemy_ABC, Base):
|
||||
|
||||
|
||||
class Parameters_MTG_Deck(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
get_all_deck: bool
|
||||
get_inactive_deck: bool
|
||||
deck_ids: str
|
||||
deck_names: str
|
||||
commander_bracket_ids: str
|
||||
include_commander_option: bool
|
||||
created_by_user_ids: str
|
||||
get_all_game: bool
|
||||
get_inactive_game: bool
|
||||
game_ids: str
|
||||
filter_by_game_session_not_player: bool
|
||||
get_all_user: bool
|
||||
get_inactive_user: bool
|
||||
user_ids: str
|
||||
require_all_id_filters_met: bool
|
||||
require_any_id_filters_met: bool
|
||||
require_all_non_id_filters_met: bool
|
||||
require_any_non_id_filters_met: bool
|
||||
|
||||
@classmethod
|
||||
def get_default(cls, user_id):
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
get_all_deck = False
|
||||
access_user_id = user_id_session
|
||||
, get_all_deck = False
|
||||
, get_inactive_deck = False
|
||||
, deck_ids = ''
|
||||
, deck_names = ''
|
||||
, commander_bracket_ids = ''
|
||||
, include_commander_option = True
|
||||
, created_by_user_ids = str(user_id)
|
||||
, get_all_game = False
|
||||
, get_all_game = True
|
||||
, get_inactive_game = False
|
||||
, game_ids = ''
|
||||
, filter_by_game_session_not_player = False
|
||||
, get_all_user = True
|
||||
, get_inactive_user = False
|
||||
, user_ids = ''
|
||||
, require_all_id_filters_met = False
|
||||
, require_any_id_filters_met = True
|
||||
, require_all_non_id_filters_met = False
|
||||
@@ -147,17 +151,19 @@ class Parameters_MTG_Deck(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
get_all_deck = json.get('a_get_all_deck', False)
|
||||
access_user_id = json.get('a_access_user_id', None)
|
||||
, get_all_deck = json.get('a_get_all_deck', False)
|
||||
, get_inactive_deck = json.get('a_get_inactive_deck', False)
|
||||
, deck_ids = json.get('a_deck_ids', '')
|
||||
, deck_names = json.get('a_deck_names', '')
|
||||
, commander_bracket_ids = json.get('a_commander_bracket_ids', '')
|
||||
, include_commander_option = json.get('a_include_commander_option', True)
|
||||
, created_by_user_ids = json.get('a_created_by_user_ids', '')
|
||||
, get_all_game = json.get('a_get_all_game', False)
|
||||
, get_inactive_game = json.get('a_get_inactive_game', False)
|
||||
, game_ids = json.get('a_game_ids', '')
|
||||
, filter_by_game_session_not_player = json.get('a_filter_by_game_session_not_player', True)
|
||||
, get_all_user = json.get('a_get_all_user', False)
|
||||
, get_inactive_user = json.get('a_get_inactive_user', False)
|
||||
, user_ids = json.get('a_user_ids', '')
|
||||
, require_all_id_filters_met = json.get('a_require_all_id_filters_met', True)
|
||||
, require_any_id_filters_met = json.get('a_require_any_id_filters_met', True)
|
||||
, require_all_non_id_filters_met = json.get('a_require_all_non_id_filters_met', False)
|
||||
@@ -166,17 +172,19 @@ class Parameters_MTG_Deck(Get_Many_Parameters_Base):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_get_all_deck': self.get_all_deck
|
||||
'a_access_user_id': self.access_user_id
|
||||
, 'a_get_all_deck': self.get_all_deck
|
||||
, 'a_get_inactive_deck': self.get_inactive_deck
|
||||
, 'a_deck_ids': self.deck_ids
|
||||
, 'a_deck_names': self.deck_names
|
||||
, 'a_commander_bracket_ids': self.commander_bracket_ids
|
||||
, 'a_include_commander_option': self.include_commander_option
|
||||
, 'a_created_by_user_ids': self.created_by_user_ids
|
||||
, 'a_get_all_game': self.get_all_game
|
||||
, 'a_get_inactive_game': self.get_inactive_game
|
||||
, 'a_game_ids': self.game_ids
|
||||
, 'a_filter_by_game_session_not_player': self.filter_by_game_session_not_player
|
||||
, 'a_get_all_user': self.get_all_user
|
||||
, 'a_get_inactive_user': self.get_inactive_user
|
||||
, 'a_user_ids': self.user_ids
|
||||
, 'a_require_all_id_filters_met': self.require_all_id_filters_met
|
||||
, 'a_require_any_id_filters_met': self.require_any_id_filters_met
|
||||
, 'a_require_all_non_id_filters_met': self.require_all_non_id_filters_met
|
||||
@@ -186,17 +194,19 @@ class Parameters_MTG_Deck(Get_Many_Parameters_Base):
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_get_all_deck': Boolean
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_all_deck': Boolean
|
||||
, 'a_get_inactive_deck': Boolean
|
||||
, 'a_deck_ids': Text
|
||||
, 'a_deck_names': Text
|
||||
, 'a_commander_bracket_ids': Text
|
||||
, 'a_include_commander_option': Boolean
|
||||
, 'a_created_by_user_ids': Text
|
||||
, 'a_get_all_game': Boolean
|
||||
, 'a_get_inactive_game': Boolean
|
||||
, 'a_game_ids': Text
|
||||
, 'a_filter_by_game_session_not_player': Boolean
|
||||
, 'a_get_all_user': Boolean
|
||||
, 'a_get_inactive_user': Boolean
|
||||
, 'a_user_ids': Text
|
||||
, 'a_require_all_id_filters_met': Boolean
|
||||
, 'a_require_any_id_filters_met': Boolean
|
||||
, 'a_require_all_non_id_filters_met': Boolean
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: MTG Deck Commander Bracket Business Object
|
||||
@@ -16,6 +16,7 @@ from helpers.helper_app import Helper_App
|
||||
# external
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
|
||||
|
||||
class MTG_Deck_Commander_Bracket(SQLAlchemy_ABC, Base):
|
||||
@@ -100,6 +101,7 @@ class MTG_Deck_Commander_Bracket(SQLAlchemy_ABC, Base):
|
||||
|
||||
|
||||
class Parameters_MTG_Deck_Commander_Bracket(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
get_all_commander_bracket: bool
|
||||
get_inactive_commander_bracket: bool
|
||||
commander_bracket_ids: str
|
||||
@@ -110,9 +112,10 @@ class Parameters_MTG_Deck_Commander_Bracket(Get_Many_Parameters_Base):
|
||||
require_any_non_id_filters_met: bool
|
||||
|
||||
@classmethod
|
||||
def get_default(cls):
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
get_all_commander_bracket = True
|
||||
access_user_id = user_id_session
|
||||
, get_all_commander_bracket = True
|
||||
, get_inactive_commander_bracket = False
|
||||
, commander_bracket_ids = ''
|
||||
, commander_bracket_names = ''
|
||||
@@ -125,7 +128,8 @@ class Parameters_MTG_Deck_Commander_Bracket(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
get_all_commander_bracket = json.get('a_get_all_commander_bracket', True)
|
||||
access_user_id = json.get('a_access_user_id', None)
|
||||
, get_all_commander_bracket = json.get('a_get_all_commander_bracket', True)
|
||||
, get_inactive_commander_bracket = json.get('a_get_inactive_commander_bracket', False)
|
||||
, commander_bracket_ids = json.get('a_commander_bracket_ids', '')
|
||||
, commander_bracket_names = json.get('a_commander_bracket_names', '')
|
||||
@@ -137,7 +141,8 @@ class Parameters_MTG_Deck_Commander_Bracket(Get_Many_Parameters_Base):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_get_all_commander_bracket': self.get_all_commander_bracket
|
||||
'a_access_user_id': self.access_user_id
|
||||
, 'a_get_all_commander_bracket': self.get_all_commander_bracket
|
||||
, 'a_get_inactive_commander_bracket': self.get_inactive_commander_bracket
|
||||
, 'a_commander_bracket_ids': self.commander_bracket_ids
|
||||
, 'a_commander_bracket_names': self.commander_bracket_names
|
||||
@@ -146,3 +151,17 @@ class Parameters_MTG_Deck_Commander_Bracket(Get_Many_Parameters_Base):
|
||||
, 'a_require_all_non_id_filters_met': self.require_all_non_id_filters_met
|
||||
, 'a_require_any_non_id_filters_met': self.require_any_non_id_filters_met
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_all_commander_bracket': Boolean
|
||||
, 'a_get_inactive_commander_bracket': Boolean
|
||||
, 'a_commander_bracket_ids': Text
|
||||
, 'a_commander_bracket_names': Text
|
||||
, 'a_require_all_id_filters_met': Boolean
|
||||
, 'a_require_any_id_filters_met': Boolean
|
||||
, 'a_require_all_non_id_filters_met': Boolean
|
||||
, 'a_require_any_non_id_filters_met': Boolean
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: MTG Game Business Object
|
||||
@@ -18,7 +18,7 @@ from datetime import datetime
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
from sqlalchemy import bindparam
|
||||
from sqlalchemy.types import Text, Boolean
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
|
||||
|
||||
class MTG_Game(SQLAlchemy_ABC, Base):
|
||||
@@ -147,6 +147,7 @@ class MTG_Game(SQLAlchemy_ABC, Base):
|
||||
'''
|
||||
|
||||
class Parameters_MTG_Game(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
get_all_game: bool
|
||||
get_inactive_game: bool
|
||||
game_ids: str
|
||||
@@ -159,7 +160,8 @@ class Parameters_MTG_Game(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
get_all_game = True
|
||||
access_user_id = user_id_session
|
||||
, get_all_game = True
|
||||
, get_inactive_game = False
|
||||
, game_ids = ''
|
||||
, get_all_user = False
|
||||
@@ -172,7 +174,8 @@ class Parameters_MTG_Game(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
get_all_game = json.get('a_get_all_game', False)
|
||||
access_user_id = json.get('a_access_user_id', None)
|
||||
, get_all_game = json.get('a_get_all_game', False)
|
||||
, get_inactive_game = json.get('a_get_inactive_game', False)
|
||||
, game_ids = json.get('a_game_ids', '')
|
||||
, get_all_user = json.get('a_get_all_user', False)
|
||||
@@ -184,7 +187,8 @@ class Parameters_MTG_Game(Get_Many_Parameters_Base):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_get_all_game': self.get_all_game
|
||||
'a_access_user_id': self.access_user_id
|
||||
, 'a_get_all_game': self.get_all_game
|
||||
, 'a_get_inactive_game': self.get_inactive_game
|
||||
, 'a_game_ids': str(self.game_ids)
|
||||
, 'a_get_all_user': self.get_all_user
|
||||
@@ -196,7 +200,8 @@ class Parameters_MTG_Game(Get_Many_Parameters_Base):
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_get_all_game': Boolean
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_all_game': Boolean
|
||||
, 'a_get_inactive_game': Boolean
|
||||
, 'a_game_ids': Text
|
||||
, 'a_get_all_user': Boolean
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: MTG Game Player Business Object
|
||||
@@ -19,7 +19,7 @@ from helpers.helper_app import Helper_App
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
from sqlalchemy import Uuid
|
||||
from sqlalchemy.types import Text, Boolean
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
# import uuid
|
||||
|
||||
class MTG_Game_Player(SQLAlchemy_ABC, Base):
|
||||
@@ -151,6 +151,7 @@ class MTG_Game_Player_Temp(db.Model, Base):
|
||||
|
||||
|
||||
class Parameters_MTG_Game_Player(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
get_all_game: bool
|
||||
get_inactive_game: bool
|
||||
game_ids: str
|
||||
@@ -160,7 +161,8 @@ class Parameters_MTG_Game_Player(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
get_all_game = True
|
||||
access_user_id = user_id_session
|
||||
, get_all_game = True
|
||||
, get_inactive_game = False
|
||||
, game_ids = ''
|
||||
, require_all_id_filters_met = True
|
||||
@@ -170,7 +172,8 @@ class Parameters_MTG_Game_Player(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
get_all_game = json.get('a_get_all_game', False)
|
||||
access_user_id = json.get('a_access_user_id', None)
|
||||
, get_all_game = json.get('a_get_all_game', False)
|
||||
, get_inactive_game = json.get('a_get_inactive_game', False)
|
||||
, game_ids = json.get('a_game_ids', '')
|
||||
, require_all_id_filters_met = json.get('a_require_all_id_filters_met', True)
|
||||
@@ -179,7 +182,8 @@ class Parameters_MTG_Game_Player(Get_Many_Parameters_Base):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_get_all_game': self.get_all_game
|
||||
'a_access_user_id': self.access_user_id
|
||||
, 'a_get_all_game': self.get_all_game
|
||||
, 'a_get_inactive_game': self.get_inactive_game
|
||||
, 'a_game_ids': self.game_ids
|
||||
, 'a_require_all_id_filters_met': self.require_all_id_filters_met
|
||||
@@ -189,7 +193,8 @@ class Parameters_MTG_Game_Player(Get_Many_Parameters_Base):
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_get_all_game': Boolean
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_all_game': Boolean
|
||||
, 'a_get_inactive_game': Boolean
|
||||
, 'a_game_ids': Text
|
||||
, 'a_require_all_id_filters_met': Boolean
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: MTG Game Round Business Object
|
||||
@@ -17,7 +17,7 @@ from helpers.helper_app import Helper_App
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
from sqlalchemy import Uuid
|
||||
from sqlalchemy.types import Text, Boolean
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
|
||||
|
||||
class MTG_Game_Round(SQLAlchemy_ABC, Base):
|
||||
@@ -130,6 +130,7 @@ class MTG_Game_Round_Temp(db.Model, Base):
|
||||
|
||||
|
||||
class Parameters_MTG_Game_Round(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
get_all_game: bool
|
||||
get_inactive_game: bool
|
||||
game_ids: str
|
||||
@@ -139,7 +140,8 @@ class Parameters_MTG_Game_Round(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
get_all_game = True
|
||||
access_user_id = user_id_session
|
||||
, get_all_game = True
|
||||
, get_inactive_game = False
|
||||
, game_ids = ''
|
||||
, require_all_id_filters_met = True
|
||||
@@ -149,7 +151,8 @@ class Parameters_MTG_Game_Round(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
get_all_game = json.get('a_get_all_game', False)
|
||||
access_user_id = json.get('a_access_user_id', None)
|
||||
, get_all_game = json.get('a_get_all_game', False)
|
||||
, get_inactive_game = json.get('a_get_inactive_game', False)
|
||||
, game_ids = json.get('a_game_ids', '')
|
||||
, require_all_id_filters_met = json.get('a_require_all_id_filters_met', True)
|
||||
@@ -158,7 +161,8 @@ class Parameters_MTG_Game_Round(Get_Many_Parameters_Base):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_get_all_game': self.get_all_game
|
||||
'a_access_user_id': self.access_user_id
|
||||
, 'a_get_all_game': self.get_all_game
|
||||
, 'a_get_inactive_game': self.get_inactive_game
|
||||
, 'a_game_ids': self.game_ids
|
||||
, 'a_require_all_id_filters_met': self.require_all_id_filters_met
|
||||
@@ -168,7 +172,8 @@ class Parameters_MTG_Game_Round(Get_Many_Parameters_Base):
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_get_all_game': Boolean
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_all_game': Boolean
|
||||
, 'a_get_inactive_game': Boolean
|
||||
, 'a_game_ids': Text
|
||||
, 'a_require_all_id_filters_met': Boolean
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: MTG Game Round Player Damage Business Object
|
||||
@@ -17,7 +17,7 @@ from helpers.helper_app import Helper_App
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
from sqlalchemy import Uuid
|
||||
from sqlalchemy.types import Text, Boolean
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
|
||||
|
||||
class MTG_Game_Round_Player_Damage(SQLAlchemy_ABC, Base):
|
||||
@@ -163,6 +163,7 @@ class MTG_Game_Round_Player_Damage_Temp(db.Model, Base):
|
||||
|
||||
|
||||
class Parameters_MTG_Game_Round_Player_Damage(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
get_all_game: bool
|
||||
get_inactive_game: bool
|
||||
game_ids: str
|
||||
@@ -172,7 +173,8 @@ class Parameters_MTG_Game_Round_Player_Damage(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
get_all_game = True
|
||||
access_user_id = user_id_session
|
||||
, get_all_game = True
|
||||
, get_inactive_game = False
|
||||
, game_ids = ''
|
||||
, require_all_id_filters_met = True
|
||||
@@ -182,7 +184,8 @@ class Parameters_MTG_Game_Round_Player_Damage(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
get_all_game = json.get('a_get_all_game', False)
|
||||
access_user_id = json.get('a_access_user_id', None)
|
||||
, get_all_game = json.get('a_get_all_game', False)
|
||||
, get_inactive_game = json.get('a_get_inactive_game', False)
|
||||
, game_ids = json.get('a_game_ids', '')
|
||||
, require_all_id_filters_met = json.get('a_require_all_id_filters_met', True)
|
||||
@@ -191,7 +194,8 @@ class Parameters_MTG_Game_Round_Player_Damage(Get_Many_Parameters_Base):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_get_all_game': self.get_all_game
|
||||
'a_access_user_id': self.access_user_id
|
||||
, 'a_get_all_game': self.get_all_game
|
||||
, 'a_get_inactive_game': self.get_inactive_game
|
||||
, 'a_game_ids': self.game_ids
|
||||
, 'a_require_all_id_filters_met': self.require_all_id_filters_met
|
||||
@@ -201,7 +205,8 @@ class Parameters_MTG_Game_Round_Player_Damage(Get_Many_Parameters_Base):
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_get_all_game': Boolean
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_all_game': Boolean
|
||||
, 'a_get_inactive_game': Boolean
|
||||
, 'a_game_ids': Text
|
||||
, 'a_require_all_id_filters_met': Boolean
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: MTG Game Session Member Business Object
|
||||
@@ -19,7 +19,7 @@ from helpers.helper_app import Helper_App
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
from sqlalchemy import Uuid
|
||||
from sqlalchemy.types import Text, Boolean
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
# import uuid
|
||||
|
||||
class MTG_Game_Session_Member(SQLAlchemy_ABC, Base):
|
||||
@@ -128,6 +128,7 @@ class MTG_Game_Session_Member_Temp(db.Model, Base):
|
||||
|
||||
|
||||
class Parameters_MTG_Game_Session_Member(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
get_inactive_session_member: bool
|
||||
get_all_game: bool
|
||||
get_inactive_game: bool
|
||||
@@ -141,7 +142,8 @@ class Parameters_MTG_Game_Session_Member(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
get_inactive_session_member = False
|
||||
access_user_id = user_id_session
|
||||
, get_inactive_session_member = False
|
||||
, get_all_game = True
|
||||
, get_inactive_game = False
|
||||
, game_ids = ''
|
||||
@@ -155,7 +157,8 @@ class Parameters_MTG_Game_Session_Member(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
get_inactive_session_member = json.get('a_get_inactive_session_member', False)
|
||||
access_user_id = json.get('a_access_user_id', None)
|
||||
, get_inactive_session_member = json.get('a_get_inactive_session_member', False)
|
||||
, get_all_game = json.get('a_get_all_game', False)
|
||||
, get_inactive_game = json.get('a_get_inactive_game', False)
|
||||
, game_ids = json.get('a_game_ids', '')
|
||||
@@ -168,7 +171,8 @@ class Parameters_MTG_Game_Session_Member(Get_Many_Parameters_Base):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_get_inactive_session_member': self.get_inactive_session_member
|
||||
'a_access_user_id': self.access_user_id
|
||||
, 'a_get_inactive_session_member': self.get_inactive_session_member
|
||||
, 'a_get_all_game': self.get_all_game
|
||||
, 'a_get_inactive_game': self.get_inactive_game
|
||||
, 'a_game_ids': self.game_ids
|
||||
@@ -182,7 +186,8 @@ class Parameters_MTG_Game_Session_Member(Get_Many_Parameters_Base):
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_get_inactive_session_member': Boolean
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_inactive_session_member': Boolean
|
||||
, 'a_get_all_game': Boolean
|
||||
, 'a_get_inactive_game': Boolean
|
||||
, 'a_game_ids': Text
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: Statistic Business Object
|
||||
@@ -17,7 +17,7 @@ from helpers.helper_app import Helper_App
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
from sqlalchemy import Uuid, Interval
|
||||
from sqlalchemy.types import Text, Boolean
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
|
||||
|
||||
class Statistic(SQLAlchemy_ABC, Base):
|
||||
@@ -231,6 +231,7 @@ class Statistic_Temp(db.Model, Base):
|
||||
|
||||
|
||||
class Parameters_Statistic(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
get_all_statistic: bool
|
||||
get_inactive_statistic: bool
|
||||
statistic_ids: str
|
||||
@@ -240,9 +241,10 @@ class Parameters_Statistic(Get_Many_Parameters_Base):
|
||||
require_any_id_filters_met: bool
|
||||
|
||||
@classmethod
|
||||
def get_default(cls):
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
get_all_statistic = True
|
||||
access_user_id = user_id_session
|
||||
, get_all_statistic = True
|
||||
, get_inactive_statistic = False
|
||||
, statistic_ids = ''
|
||||
, entity_type_codes = ''
|
||||
@@ -254,7 +256,8 @@ class Parameters_Statistic(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
get_all_statistic = json.get('a_get_all_statistic', False)
|
||||
access_user_id = json.get('a_access_user_id', None)
|
||||
, get_all_statistic = json.get('a_get_all_statistic', False)
|
||||
, get_inactive_statistic = json.get('a_get_inactive_statistic', False)
|
||||
, statistic_ids = json.get('a_statistic_ids', '')
|
||||
, entity_type_codes = json.get('a_entity_type_codes', '')
|
||||
@@ -265,7 +268,8 @@ class Parameters_Statistic(Get_Many_Parameters_Base):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_get_all_statistic': self.get_all_statistic
|
||||
'a_access_user_id': self.access_user_id
|
||||
, 'a_get_all_statistic': self.get_all_statistic
|
||||
, 'a_get_inactive_statistic': self.get_inactive_statistic
|
||||
, 'a_statistic_ids': self.statistic_ids
|
||||
, 'a_entity_type_codes': self.entity_type_codes
|
||||
@@ -277,7 +281,8 @@ class Parameters_Statistic(Get_Many_Parameters_Base):
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_get_all_statistic': Boolean
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_all_statistic': Boolean
|
||||
, 'a_get_inactive_statistic': Boolean
|
||||
, 'a_statistic_ids': Text
|
||||
, 'a_entity_type_codes': Text
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: User Business Object
|
||||
@@ -17,7 +17,7 @@ from helpers.helper_app import Helper_App
|
||||
# external
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar, Optional
|
||||
from sqlalchemy.types import Text, Boolean
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
|
||||
|
||||
class User(SQLAlchemy_ABC, Base):
|
||||
@@ -138,6 +138,7 @@ User (
|
||||
|
||||
|
||||
class Parameters_User(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
# user_id: Optional[int]
|
||||
# auth0_user_id: str
|
||||
get_all_user: bool
|
||||
@@ -155,12 +156,12 @@ class Parameters_User(Get_Many_Parameters_Base):
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_form_filters_user(cls, form):
|
||||
def from_form_filters_user(cls, form, user_id_session):
|
||||
_m = f'{cls.__qualname__}.from_form_filters_user'
|
||||
av.val_instance(form, 'form', _m, Filters_User)
|
||||
get_inactive = not av.input_bool(form.active_only.data, "active", _m)
|
||||
# user_id = '' if form.user_id.data is None else form.user_id.data
|
||||
filters = cls.get_default()
|
||||
filters = cls.get_default(user_id_session)
|
||||
filters.get_all_user = True # (user_id == '')
|
||||
filters.get_inactive_user = get_inactive
|
||||
filters.user_ids = '' # user_id
|
||||
@@ -170,11 +171,11 @@ class Parameters_User(Get_Many_Parameters_Base):
|
||||
# filters.require_all_non_id_filters_met = False
|
||||
# filters.require_any_non_id_filters_met = True
|
||||
return filters
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_user(cls, user):
|
||||
def from_user(cls, user, user_id_session):
|
||||
av.val_instance(user, 'user', 'Parameters_User.from_user', User)
|
||||
filters = cls.get_default()
|
||||
filters = cls.get_default(user_id_session)
|
||||
filters.get_all_user = ((user.user_id is None or user.user_id == 0) and user.user_auth0_id is None)
|
||||
filters.get_inactive_user = False
|
||||
filters.user_ids = '' if user.user_id is None else str(user.user_id)
|
||||
@@ -182,13 +183,14 @@ class Parameters_User(Get_Many_Parameters_Base):
|
||||
# filters.names_user = user.get_name()
|
||||
# filters.emails_user = user.email
|
||||
return filters
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_default(cls):
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
# user_id = None
|
||||
access_user_id = user_id_session
|
||||
# , user_id = None
|
||||
# , auth0_user_id = ''
|
||||
get_all_user = False
|
||||
, get_all_user = False
|
||||
, get_inactive_user = False
|
||||
, user_ids = ''
|
||||
# , user_auth0_ids = ''
|
||||
@@ -205,9 +207,10 @@ class Parameters_User(Get_Many_Parameters_Base):
|
||||
pass
|
||||
def to_json(self):
|
||||
return {
|
||||
# 'a_user_id': self.user_id
|
||||
'a_access_user_id': self.access_user_id
|
||||
# , 'a_user_id': self.user_id
|
||||
# , 'a_auth0_user_id': self.auth0_user_id
|
||||
'a_get_all_user': self.get_all_user
|
||||
, 'a_get_all_user': self.get_all_user
|
||||
, 'a_get_inactive_user': self.get_inactive_user
|
||||
, 'a_user_ids': self.user_ids
|
||||
# , 'a_user_auth0_ids': self.user_auth0_ids
|
||||
@@ -221,7 +224,8 @@ class Parameters_User(Get_Many_Parameters_Base):
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_get_all_user': Boolean
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_all_user': Boolean
|
||||
, 'a_get_inactive_user': Boolean
|
||||
, 'a_user_ids': Text
|
||||
, 'a_require_all_id_filters_met': Boolean
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Project: Magic Tracker
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
Shuffle & Skirmish
|
||||
|
||||
Technology: Business Objects
|
||||
Feature: User Relationship Business Object
|
||||
@@ -17,7 +17,7 @@ from helpers.helper_app import Helper_App
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
from sqlalchemy import Uuid
|
||||
from sqlalchemy.types import Text, Boolean
|
||||
from sqlalchemy.types import Text, Boolean, Integer
|
||||
# import uuid
|
||||
|
||||
class User_Relationship(SQLAlchemy_ABC, Base):
|
||||
@@ -136,6 +136,7 @@ class User_Relationship_Temp(db.Model, Base):
|
||||
|
||||
|
||||
class Parameters_User_Relationship(Get_Many_Parameters_Base):
|
||||
access_user_id: int
|
||||
get_inactive_user_relationship: bool
|
||||
get_all_user_follower: bool
|
||||
follower_user_ids: str
|
||||
@@ -148,7 +149,8 @@ class Parameters_User_Relationship(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def get_default(cls, user_id_session):
|
||||
return cls(
|
||||
get_inactive_user_relationship = True
|
||||
access_user_id = user_id_session
|
||||
, get_inactive_user_relationship = True
|
||||
, get_all_user_follower = False
|
||||
, follower_user_ids = ''
|
||||
, get_all_user_following = True
|
||||
@@ -161,7 +163,8 @@ class Parameters_User_Relationship(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
return cls(
|
||||
get_inactive_user_relationship = json.get('a_get_inactive_user_relationship', False)
|
||||
access_user_id = json.get('a_access_user_id', None)
|
||||
, get_inactive_user_relationship = json.get('a_get_inactive_user_relationship', False)
|
||||
, get_all_user_follower = json.get('a_get_all_user_follower', False)
|
||||
, follower_user_ids = json.get('a_follower_user_ids', '')
|
||||
, get_all_user_following = json.get('a_get_all_user_following', False)
|
||||
@@ -173,7 +176,8 @@ class Parameters_User_Relationship(Get_Many_Parameters_Base):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'a_get_inactive_user_relationship': self.get_inactive_user_relationship
|
||||
'a_access_user_id': self.access_user_id
|
||||
, 'a_get_inactive_user_relationship': self.get_inactive_user_relationship
|
||||
, 'a_get_all_user_follower': self.get_all_user_follower
|
||||
, 'a_follower_user_ids': self.follower_user_ids
|
||||
, 'a_get_all_user_following': self.get_all_user_following
|
||||
@@ -186,7 +190,8 @@ class Parameters_User_Relationship(Get_Many_Parameters_Base):
|
||||
@staticmethod
|
||||
def get_type_hints():
|
||||
return {
|
||||
'a_get_inactive_user_relationship': Boolean
|
||||
'a_access_user_id': Integer
|
||||
, 'a_get_inactive_user_relationship': Boolean
|
||||
, 'a_get_all_user_follower': Boolean
|
||||
, 'a_follower_user_ids': Text
|
||||
, 'a_get_all_user_following': Boolean
|
||||
|
||||
Reference in New Issue
Block a user