Static site¶
Todo
Doctrings (module, utilities)
Models¶
-
class
indico.modules.events.static.models.static.
StaticSite
(**kwargs)¶ Bases:
indico.core.storage.models.StoredFileMixin
,sqlalchemy.orm.decl_api.Model
Static site for an Indico event.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
add_file_date_column
= False¶
-
content_type
¶ The MIME type of the file.
-
created_dt
= None¶
-
creator
¶ The user who created the static site
-
creator_id
¶ ID of the user who created the static site
-
event
¶ The Event this static site is associated with
-
event_id
¶ ID of the event
-
extension
¶ The extension of the file.
-
file_required
= False¶
-
filename
¶ The name of the file.
-
id
¶ Entry ID
-
locator
¶
-
md5
¶ An MD5 hash of the file.
Automatically assigned when save() is called.
-
requested_dt
¶ The date and time the static site was requested
-
size
¶ The size of the file (in bytes).
Automatically assigned when save() is called.
-
state
¶ The state of the static site (a
StaticSiteState
member)
-
storage_backend
¶
-
storage_file_id
¶
-
Utilities¶
-
class
indico.modules.events.static.util.
RewrittenManifest
(manifest)¶ Bases:
pywebpack.manifests.Manifest
A manifest that rewrites its asset paths.
-
indico.modules.events.static.util.
collect_static_files
()¶ Keep track of URLs used by manifest and url_for.
-
indico.modules.events.static.util.
override_request_endpoint
(endpoint)¶
-
indico.modules.events.static.util.
rewrite_css_urls
(event, css)¶ Rewrite CSS in order to handle url(…) properly.
-
indico.modules.events.static.util.
rewrite_static_url
(path)¶ Remove __vxxx prefix from static URLs.
-
indico.modules.events.static.util.
url_to_static_filename
(endpoint, url)¶ Handle special endpoint/URLs so that they link to offline content.