-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Laces components provide a simple way to combine data (in the form of Python objects) with the Django templates that are meant to render that data. The components can then be simply rendered in any other template using the {% component %} template tag. That parent template does not need to know anything about the component's template or data. No need to receive, filter, restructure or pass any data to the component's template. Just let the component render itself. Template and data are tied together in the component, and they can be passed around together. This becomes especially useful when components are nested -- it allows us to avoid building the same nested structure twice (once in the data and again in the templates). Working with objects that know how to render themselves as HTML elements is a common pattern found in complex Django applications, such as the Wagtail admin interface. The Wagtail admin is also where the APIs provided in this package have previously been discovered, developed and solidified. The purpose of this package is to make these tools available to other Django projects outside the Wagtail ecosystem.
- Loading branch information
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
PORTNAME= laces | ||
PORTVERSION= 0.1.1 | ||
CATEGORIES= www python | ||
MASTER_SITES= PYPI | ||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} | ||
|
||
MAINTAINER= sunpoet@FreeBSD.org | ||
COMMENT= Django components that know how to render themselves | ||
WWW= https://github.com/tbrlpld/laces | ||
|
||
LICENSE= BSD3CLAUSE | ||
LICENSE_FILE= ${WRKSRC}/LICENSE | ||
|
||
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}django42>=3.2:www/py-django42@${PY_FLAVOR} \ | ||
${PYTHON_PKGNAMEPREFIX}flit-core>=3.2<4:devel/py-flit-core@${PY_FLAVOR} | ||
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}django42>=3.2:www/py-django42@${PY_FLAVOR} | ||
|
||
USES= python | ||
USE_PYTHON= autoplist concurrent pep517 | ||
|
||
NO_ARCH= yes | ||
|
||
.include <bsd.port.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TIMESTAMP = 1709390340 | ||
SHA256 (laces-0.1.1.tar.gz) = e45159c46f6adca33010d34e9af869e57201b70675c6dc088e919b16c89456a4 | ||
SIZE (laces-0.1.1.tar.gz) = 26889 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Laces components provide a simple way to combine data (in the form of Python | ||
objects) with the Django templates that are meant to render that data. The | ||
components can then be simply rendered in any other template using the {% | ||
component %} template tag. That parent template does not need to know anything | ||
about the component's template or data. No need to receive, filter, restructure | ||
or pass any data to the component's template. Just let the component render | ||
itself. | ||
|
||
Template and data are tied together in the component, and they can be passed | ||
around together. This becomes especially useful when components are nested -- it | ||
allows us to avoid building the same nested structure twice (once in the data | ||
and again in the templates). | ||
|
||
Working with objects that know how to render themselves as HTML elements is a | ||
common pattern found in complex Django applications, such as the Wagtail admin | ||
interface. The Wagtail admin is also where the APIs provided in this package | ||
have previously been discovered, developed and solidified. The purpose of this | ||
package is to make these tools available to other Django projects outside the | ||
Wagtail ecosystem. |