New method for update tables using directly old tables in mariadb

This commit is contained in:
Antonio de la Rosa 2024-04-16 01:27:29 +02:00
parent dec0613c75
commit 2599eabed0
9 changed files with 151 additions and 22 deletions

View file

@ -21,7 +21,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#import gettext
from mako.template import Template
from flask import session, url_for
from flask import url_for as url_for_flask
from mako.lookup import TemplateLookup
from os import path
try:
@ -37,6 +37,12 @@ from paramecio2.libraries.i18n import I18n, PGetText
from paramecio2.libraries.urls import make_url, make_media_url, add_get_parameters
from paramecio2.libraries.formsutils import csrf_token
framework='flask'
if hasattr(config, 'framework'):
framework=config.framework
"""
def _(text):
@ -91,7 +97,7 @@ class PTemplate:
templates_loaded={}
def __init__(self, environment):
def __init__(self, environment, url_for_function=None):
"""A class used how shortcuts for Mako template functions.
This class is used to have a set of shortcuts and hooks to Mako templates functions and methods over a series of default options.
@ -117,11 +123,22 @@ class PTemplate:
self.add_filter(I18n.lang)
#self.add_filter(make_url)
self.add_filter(make_url)
self.add_filter(make_media_url)
if not url_for_function:
url_for=url_for_flask
self.add_filter(url_for)
self.add_filter(url_for)
else:
url_for=url_for_function
self.add_filter(url_for)
self.add_filter(csrf_token)