{"id":15359735,"url":"https://github.com/redhog/appomatic_renderable","last_synced_at":"2025-04-06T01:41:30.362Z","repository":{"id":8512450,"uuid":"10124746","full_name":"redhog/appomatic_renderable","owner":"redhog","description":"A mini cms framework to make django models easily \"renderable\" using templates","archived":false,"fork":false,"pushed_at":"2014-12-14T21:49:58.000Z","size":240,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T21:46:01.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-17T14:14:18.000Z","updated_at":"2014-12-14T21:50:00.000Z","dependencies_parsed_at":"2022-08-30T09:32:10.893Z","dependency_job_id":null,"html_url":"https://github.com/redhog/appomatic_renderable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2Fappomatic_renderable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2Fappomatic_renderable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2Fappomatic_renderable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2Fappomatic_renderable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhog","download_url":"https://codeload.github.com/redhog/appomatic_renderable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423492,"owners_count":20936622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T12:45:59.893Z","updated_at":"2025-04-06T01:41:30.337Z","avatar_url":"https://github.com/redhog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nA mini cms framework to make django models easily \"renderable\" using templates\n\n\n# Dependencies\n\n    https://github.com/redhog/fcdjangoutils\n\n# Preparing the models\nAdd the mixin appomatic_renderable.models.Renderable to the superclasses of your model.\n\n# Usage in templates\n\n    {{somemodelobject.render_as.excerpt|safe}}\n\nThis will use the type of the object (and its base classes) together\nwith the style \"excerpt\" (you can use any string here), to determine\nwhat template to use to render the object. The template will be run,\nwith the object bound to the template variable \"obj\", and the result\nwill be returned (and inserted in the current template).\n\nIf for example somemodelobject if of class\nappomatic_myapp.models.MyModel which inherits from\nappomatic_websitebase.models.BaseModel, then the following templates\nwill be searched for (in this order, the first one found will be\nused):\n\n    appomatic_myapp/models/MyModel/excerpt.html\n    appomatic_websitebase/models/BaseModel/excerpt.html\n\nThe .html is added, unless you specify something else:\n\n    {{somemodelobject.render_as.excerpt__txt|safe}}\n\nwill use the templates\n\n    appomatic_myapp/models/MyModel/excerpt.txt\n    appomatic_websitebase/models/BaseModel/excerpt.txt\n\n# Built in styles\n\n* link__html\n\n  Generates a link (a href) to the object using unicode(obj) to\n  generate the link title, and obj.get_absolute_url() to generate the\n  url\n\n* adminlink__html\n\n  Generates a link to the django admin page for editing this object,\n  using obj.get_admin_url().\n\n* oembedlink__html\n\n  Generates proper html tags linking to an oembed provider for this\n  object.\n\n* oembed\n\n  Generates oembed data for your object. Uses the query parameter\n  \"format\" to determine if it is to generate cml or json oembed data,\n  default is json.\n\n\n# Views\n\nFor models inheriting from either appomatic_renderable.models.Tag or\nappomatic_renderable.models.Node a url is provided, resolving to a\nview that renders the object using the same logic as the template tag,\nusing the style \"page.html\" (by default, the style can be overridden\nusing a query parameter \"style\").\n\n\n# Lists \n\nThere is also a list rendering mode, which uses the same template\ntemplate lookup mechanism as the instance renderer, but with \"-list\"\nappended to the class name, e.g.\n\n    appomatic_renderable/models/Node-list/page.html\n\nThis is made available for Tag:s and Node:s under the urls /tag/ and\n/node/ respectively.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhog%2Fappomatic_renderable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhog%2Fappomatic_renderable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhog%2Fappomatic_renderable/lists"}