"trial"
', tags=('p')) + """ soup=BeautifulSoup(value, features='html.parser') for tag in soup.findAll(True): + if tag.name not in self.trusted_tags: tag.hidden=True @@ -227,7 +296,18 @@ class HTMLField(TextField): return value - + """ + + value=bleach.clean(value, tags=self.trusted_tags) + + if self.escape: + + return value.replace('"', '"') + else: + + return value + + class ForeignKeyField(IntegerField): """Subclass of IntegerField for create Foreign keys @@ -305,6 +385,12 @@ class BooleanField(IntegerField): self.default_error="Need 0 or 1 value" self.default_value=0 + self.type_sql='tinyint(1)' + + self.jtype='boolean' + #self.jformat='0' + self.jexample='0' + def check(self, value): self.error=False diff --git a/paramecio2/libraries/db/coreforms.py b/paramecio2/libraries/db/coreforms.py index 6a37dd8..427090f 100644 --- a/paramecio2/libraries/db/coreforms.py +++ b/paramecio2/libraries/db/coreforms.py @@ -1,5 +1,24 @@ #!/usr/bin/env python3 +""" +Paramecio2fm is a series of wrappers for Flask, mako and others and construct a simple headless cms. + +Copyright (C) 2023 Antonio de la Rosa Caballero + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see