self.chapter2RST(doc) self.footer2RST(doc) def toUML(self, dot): for m in self.models: m.toUML_add_model(dot) for m in self.models: m.toUML_add_attributes(dot) def toSQL(self, dot): for m in self.models: m.toSQL_add_table(dot) for m in self.models: m.toSQL_add_fields(dot) def toRST_blok(self, doc): self._toRST(doc, self.registry.Documentation.Blok, self.bloks) def toRST_model(self, doc): self._toRST(doc, self.registry.Documentation.Model, self.models) from . import blok # noqa reload_module_if_blok_is_reloading(blok) from . import model # noqa reload_module_if_blok_is_reloading(model)
@classmethod def get_js_babel(cls): """ return the babel paths """ return (cls.get_static('global_js_babel') + cls.get_static('client_js_babel')) @classmethod def get_templates(cls): """ Return the list of the web client template to load """ from os.path import join tmpl = Template(forclient=True) Blok = cls.registry.System.Blok for blok in Blok.list_by_state('installed'): b = BlokManager.get(blok) if hasattr(b, 'client_templates'): bpath = BlokManager.getPath(blok) for template in b.client_templates: with open(join(bpath, template), 'r') as fp: tmpl.load_file(fp) tmpl.compile() return tmpl.get_all_template() from . import space # noqa reload_module_if_blok_is_reloading(space) from . import login # noqa reload_module_if_blok_is_reloading(login) from . import user # noqa reload_module_if_blok_is_reloading(user)
# This file is a part of the AnyBlok project # # Copyright (C) 2015 Jean-Sebastien SUZANNE <*****@*****.**> # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file,You can # obtain one at http://mozilla.org/MPL/2.0/. from anyblok import Declarations, reload_module_if_blok_is_reloading @Declarations.register(Declarations.Model) class System: pass from . import model # noqa reload_module_if_blok_is_reloading(model) from . import field # noqa reload_module_if_blok_is_reloading(field) from . import column # noqa reload_module_if_blok_is_reloading(column) from . import relationship # noqa reload_module_if_blok_is_reloading(relationship) from . import blok # noqa reload_module_if_blok_is_reloading(blok) from . import cache # noqa reload_module_if_blok_is_reloading(cache) from . import parameter # noqa reload_module_if_blok_is_reloading(parameter) from . import sequence # noqa reload_module_if_blok_is_reloading(sequence) from . import cron # noqa
from anyblok import Declarations, reload_module_if_blok_is_reloading @Declarations.register(Declarations.Model) class UI: pass from . import action # noqa reload_module_if_blok_is_reloading(action) from . import menu # noqa reload_module_if_blok_is_reloading(menu) from . import view # noqa reload_module_if_blok_is_reloading(view) from . import transition # noqa reload_module_if_blok_is_reloading(transition) from . import button # noqa reload_module_if_blok_is_reloading(button) from . import image # noqa reload_module_if_blok_is_reloading(image)
# This file is a part of the AnyBlok project # # Copyright (C) 2015 Jean-Sebastien SUZANNE <*****@*****.**> # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file,You can # obtain one at http://mozilla.org/MPL/2.0/. from anyblok import Declarations, reload_module_if_blok_is_reloading @Declarations.register(Declarations.Model) class System: pass from . import model # noqa reload_module_if_blok_is_reloading(model) from . import field # noqa reload_module_if_blok_is_reloading(field) from . import column # noqa reload_module_if_blok_is_reloading(column) from . import relationship # noqa reload_module_if_blok_is_reloading(relationship) from . import blok # noqa reload_module_if_blok_is_reloading(blok) from . import cache # noqa reload_module_if_blok_is_reloading(cache) from . import parameter # noqa reload_module_if_blok_is_reloading(parameter) from . import sequence # noqa reload_module_if_blok_is_reloading(sequence)
msg = 'Properties:\n\n* ' + '\n* '.join('**%s** : %s' % (x, y) for x, y in properties.items()) doc.write(msg + '\n\n') def toUML_add_model(self, dot): dot.add_class(self.model.name) def toUML_add_attributes(self, dot): for f in self.fields: f.toUML(dot) for attr in self.attributes: attr.toUML(dot, self.model.name) def toSQL_add_table(self, dot): Model = self.anyblok.get(self.model.name) if hasattr(Model, '__tablename__'): dot.add_table(Model.__tablename__) def toSQL_add_fields(self, dot): Model = self.anyblok.get(self.model.name) if hasattr(Model, '__tablename__'): for f in self.fields: f.toSQL(dot) from . import field # noqa reload_module_if_blok_is_reloading(field) from . import attribute # noqa reload_module_if_blok_is_reloading(attribute)
if hasattr(b, static_type): for static_url in getattr(b, static_type): res.append(cls.format_static(blok, static_url)) return res @classmethod def get_css(cls): """ Return the css paths """ return cls.get_static('css') @classmethod def get_js(cls): """ return the js paths """ return cls.get_static('js') from . import space # noqa reload_module_if_blok_is_reloading(space) from . import action # noqa reload_module_if_blok_is_reloading(action) from . import menu # noqa reload_module_if_blok_is_reloading(menu) from . import view # noqa reload_module_if_blok_is_reloading(view) from . import button # noqa reload_module_if_blok_is_reloading(button) from . import search # noqa reload_module_if_blok_is_reloading(search) from . import image # noqa reload_module_if_blok_is_reloading(image)
# flake8: noqa # This file is a part of the AnyBlok project # # Copyright (C) 2014 Jean-Sebastien SUZANNE <*****@*****.**> # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file,You can # obtain one at http://mozilla.org/MPL/2.0/. from anyblok import reload_module_if_blok_is_reloading from . import base reload_module_if_blok_is_reloading(base) from . import sqlbase reload_module_if_blok_is_reloading(sqlbase) from . import sqlviewbase reload_module_if_blok_is_reloading(sqlviewbase) from . import session reload_module_if_blok_is_reloading(session) from . import query reload_module_if_blok_is_reloading(query) from . import instrumentedlist reload_module_if_blok_is_reloading(instrumentedlist)
from anyblok import reload_module_if_blok_is_reloading from . import sqlbase reload_module_if_blok_is_reloading(sqlbase)
doc.write('\n'.join([quote, title, quote, '\n'])) self.header2RST(doc) self.chapter2RST(doc) self.footer2RST(doc) def toUML(self, dot): for m in self.models: m.toUML_add_model(dot) for m in self.models: m.toUML_add_attributes(dot) def toSQL(self, dot): for m in self.models: m.toSQL_add_table(dot) for m in self.models: m.toSQL_add_fields(dot) def toRST_blok(self, doc): self._toRST(doc, self.registry.Documentation.Blok, self.bloks) def toRST_model(self, doc): self._toRST(doc, self.registry.Documentation.Model, self.models) from . import blok # noqa reload_module_if_blok_is_reloading(blok) from . import model # noqa reload_module_if_blok_is_reloading(model)
msg = 'Properties:\n\n* ' + '\n* '.join('**%s** : %s' % (x, y) for x, y in properties.items()) doc.write(msg + '\n\n') def toUML_add_model(self, dot): dot.add_class(self.model.name) def toUML_add_attributes(self, dot): for f in self.fields: f.toUML(dot) for attr in self.attributes: attr.toUML(dot, self.model.name) def toSQL_add_table(self, dot): Model = self.registry.get(self.model.name) if hasattr(Model, '__tablename__'): dot.add_table(Model.__tablename__) def toSQL_add_fields(self, dot): Model = self.registry.get(self.model.name) if hasattr(Model, '__tablename__'): for f in self.fields: f.toSQL(dot) from . import field # noqa reload_module_if_blok_is_reloading(field) from . import attribute # noqa reload_module_if_blok_is_reloading(attribute)
from anyblok import Declarations, reload_module_if_blok_is_reloading @Declarations.register(Declarations.Model) class Access: pass from . import group # noqa reload_module_if_blok_is_reloading(group)