This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| methods: { | |
| get_objetos_gastos() { | |
| this.$service.get('../api/objetos_gastos') | |
| then(response => { | |
| this.objetos_gastos = response.data || []; | |
| }) | |
| }, | |
| get_objeto(codigo) { | |
| return this.objetos_gastos.find(item => item.codigo === codigo) || {} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root = true | |
| [*] | |
| indent_size = 2 | |
| indent_style = space | |
| end_of_line = crlf | |
| insert_final_newline = true | |
| trim_trailing_whitespace = true | |
| charset = utf-8 | |
| max_line_length = off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| computed: { | |
| filtered_list(){ | |
| if (!this.filter){ | |
| return this.proveedores; | |
| } | |
| function filter01(item, filter){ | |
| return item.razon_social?.toString().toLowerCase().includes(filter); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BackupApi(MethodView): | |
| def get(self): | |
| def filesize_humanize(size): | |
| if size < 1024: | |
| return f'{size} bytes' | |
| elif size < 1024 * 1024: | |
| return f'{size / 1024:.2f} KB' | |
| elif size < 1024 * 1024 * 1024: | |
| return f'{size / 1024 / 1024:.2f} MB' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import flash, session | |
| from core.logs import logger | |
| str_message_success = 'Operación ejecutada con exito' | |
| str_message_error = 'Ha ocurrido un error al ejecutar la operación' | |
| def success_message(msg: str = None): | |
| """Show positive flash message""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import wraps | |
| def require_permission(func): | |
| @wraps(func) | |
| def eval_permission(permission: str, *args, **kwargs): | |
| return func(*args, **kwargs) | |
| return eval_permission |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CustomJsonEncoder(json.JSONEncoder): | |
| def default(self, obj): | |
| if isinstance(obj, list): | |
| return [self.default(o) for o in obj] | |
| elif isinstance(obj, datetime.date): | |
| return obj.isoformat() | |
| elif isinstance(obj, datetime.datetime): | |
| return obj.isoformat() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function generateUUID(){ | |
| return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
| let r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8); | |
| return v.toString(16); | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.3' | |
| volumes: | |
| database: | |
| services: | |
| database: | |
| image: mysql/mysql-server:latest | |
| container_name: database | |
| command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # @app.before_first_request | |
| # def before_first_request(): | |
| # logger.debug("Verificando modelos") | |
| # models = ModelBase.__subclasses__() | |
| # logger.debug(f"modelos encontrados: {models}") | |
| # check_models_requirements(models) | |
| # def check_models_requirements(models): | |
| # """Check if the models are created in the database, if not, create them.""" |
NewerOlder