Django models¶
Collection¶
GroupSvg¶
-
class
snowebsvg.models.
GroupSvg
(id, key, collection)¶ - Parameters
id (AutoField) – Id
key (CharField) – Key
collection (ForeignKey to
Collection
) – Collection
-
build
()¶ Build all
Svg
available in django apps template folder named :snowebsvg/collections/<collection_key>/<group_svg_key>
-
path_entry
¶ File path of a
GroupSvg
Svg¶
-
class
snowebsvg.models.
Svg
(id, key, group)¶ - Parameters
id (AutoField) – Id
key (CharField) – Key
group (ForeignKey to
GroupSvg
) – Group
-
key_composer
¶ - Return string
Unique Identifier of Svg
-
key_decomposer
(key_composer)¶ - Return svg
Svg instance by key composer
-
path_entry
¶ - Return string
Path html of Svg
-
render_django
(theme='light', width=100, height=100, variant=None)¶ Method for rendering Django template code
- Parameters
theme – Theme, defaults to SVG_DEFAULT_THEME
width – Width, defaults SVG_DEFAULT_WIDTH
height – Height, defaults SVG_DEFAULT_HEIGHT
variant – Variant, defaults SVG_DEFAULT_VARIANT
-
render_html
(theme='light', width=100, height=100, variant=None, grid=False, klass=None)¶ Method for rendering Svg to HTML
- Parameters
theme – Theme, defaults to SVG_DEFAULT_THEME
width – Width, defaults SVG_DEFAULT_WIDTH
height – Height, defaults SVG_DEFAULT_HEIGHT
grid – Grid, add grid for debugging SVG, defaults to False`
variant – Variant, defaults SVG_DEFAULT_VARIANT
klass – extra css class
-
render_preview
(theme='light', width=100, height=100, variant=None, grid=False, klass=None)¶ Method for rendering a preview of Svg to HTML
If _preview.html exist, then render the preview html file. If _preview.html does not exist, then fall back to the common preview.html file.
- Parameters
theme – Theme, defaults to SVG_DEFAULT_THEME
width – Width, defaults SVG_DEFAULT_WIDTH
height – Height, defaults SVG_DEFAULT_HEIGHT
grid – Grid, add grid for debugging SVG, defaults to False`
variant – Variant, defaults SVG_DEFAULT_VARIANT
klass – extra css class