Open ojii opened 12 years ago
The one reason we did use the db approach was to have categories -- which we are not using ATM anyway. I'd be OK with this change.
categories could still be done using nested dicts
they wouldn't even have to be nested, just one level, e.g.
TEXT_NG_TEMPLATES = {
'Images': (
('text_ng/image_large.html', 'Large Image'),
('text_ng/image_small.html', 'Small Image'),
),
'Textblocks': (
('text_ng/text_left.html', 'Text (left)'),
('text_ng/text_right.html', 'Text (right)'),
),
}
/edit: on a second thought, this is actually a nested dict in disguise :)
yea either use dicts there or at the very least a list for the outer things.
To remove unnecessary file parsing all additional fields (now defined in the template) could also be in the settings. Eg.:
TEXT_NG_TEMPLATES = {
'FunnySections': (
('text_ng/funnysection_left.html', 'Text (left)', {'body':'htmltext', 'h2_content':'text', 'icon':'filer_image'}),
('text_ng/funnysection_right.html', 'Text (right)', {'body':'htmltext'),
),
}
It would make a lot of sense to have the templates defined in a setting, not in the database: