Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yourlabs/django-xcbv
UNUSABLE heavy research around cbv for the lulz, see crudlfap for usable code
https://github.com/yourlabs/django-xcbv
Last synced: 3 months ago
JSON representation
UNUSABLE heavy research around cbv for the lulz, see crudlfap for usable code
- Host: GitHub
- URL: https://github.com/yourlabs/django-xcbv
- Owner: yourlabs
- Created: 2018-03-10T18:07:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-05T08:31:44.000Z (over 2 years ago)
- Last Synced: 2024-04-04T03:41:42.784Z (7 months ago)
- Language: Python
- Homepage: https://club.yourlabs.org
- Size: 42 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
- starred-awesome - django-xcbv - UNUSABLE heavy research around cbv for the lulz, see crudlfap for usable code (Python)
README
.. image:: https://img.shields.io/readthedocs/xcbv.svg?style=for-the-badge
:target: https://xcbv.readthedocs.io
.. image:: https://img.shields.io/circleci/project/github/yourlabs/xcbv/master.svg?style=for-the-badge
:target: https://circleci.com/gh/yourlabs/xcbv
.. image:: https://img.shields.io/codecov/c/github/yourlabs/xcbv/master.svg?style=for-the-badge
:target: https://codecov.io/gh/yourlabs/xcbv
.. image:: https://img.shields.io/npm/v/xcbv.svg?style=for-the-badge
:target: https://www.npmjs.com/package/xcbv
.. image:: https://img.shields.io/pypi/v/xcbv.svg?style=for-the-badge
:target: https://pypi.python.org/pypi/xcbvWhat it is
==========- remove need of urls.py in favor of nested views,
- nested security checking support,
- take DRY to another level with nested views.
- django can you generate a menu is: yes,
- modern pattern for creating your own admin-like CRUD,Extracted from CRUDLFA+, re DDD'd, under TDD.
.. code-block:: python
# yourapp.views
urlpatterns = xcbv.View(
menus=('global', 'footer'),
views=(
xcbv.ModelView.factory(
model=YourModel,
# updates views.list, views.update
children=xcbv.ModelView.views.update(
YourListView.factory(
# by default only staff sees new views, this opens for all
allows=lambda self: True
),
YourUpdateView.factory(
# could be set here or inside the view
path='specialupdate//',
),
YourDetailView.factory(
# just adding a sub object list view inside URL and
# permission tree like a Poney, is this going to be a
# list of child models from the above ModelView model ?
views=xcbv.ModelListView(
model=YourChildModel,
)
)
),
icon="fa-love",
),
YourOtherView,
),
# some default overrides
namespace='yourapp',
prefix='you/',
).as_urlpatterns()# yourproject.urls
urlpatterns += path('yourmodel/', yourapp.views.router.as_urlpatterns())# in templates
# menu for navigation
{% for view in |views_in_menu:''|views_allowing:request %}
{% endfor %}# menu for model
{% for view in self|views_in_menu:'model'|views_allowing:request %}
{% endfor %}# menu for object
{% for view in self|views_in_menu:'object'|views_allowing:request %}
{% endfor %}Demo
====Run the demo which uses Django server side::
pip install --user xcbv[demo]
~/.local/bin/xcbv runserverResources
=========- `**Documentation** graciously hosted
`_ by `RTFD
`_
- `Mailing list graciously hosted
`_ by `Google
`_
- For **Security** issues, please contact [email protected]
- `Git graciously hosted
`_ by `GitHub
`_,
- `Package graciously hosted
`_ by `PyPi
`_,
- `Continuous integration graciously hosted
`_ by `CircleCI
`_
- `**Online paid support** provided via HackHands
`_,