jet-django | Jet Bridge for Jet Admin – Admin panel framework | Dashboard library
kandi X-RAY | jet-django Summary
kandi X-RAY | jet-django Summary
Jet Bridge (Django) for Jet Admin – Admin panel framework for your application
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a filter class based on model fields
- Returns a filter based on a lookup type
- Return the name of a csv filter class
- Create a filter for a field
- Creates a model viewset
- Returns the serializer instance
- Decorator to decorate a view function
- Decorator for methods
- Return a dict representation of the model
- Select the appropriate renderer based on the request
- Performs a project auth request
- Include the documentation files
- Serialize data into JSON
- Resolve internal value
- Returns a list of urls
- Render the data
- Get the fields of the serializer
- URLize URLs
- Paginate a queryset
- List all registered models
- Return a view as a view
- Return the hyperlink representation of the target
- Convert a dictionary to a list of values
- Save the serializer
- Create a new object from validated data
- Parse the given stream
jet-django Key Features
jet-django Examples and Code Snippets
Community Discussions
Trending Discussions on jet-django
QUESTION
I use a CMS that does a mapping of my models through an API at runtime.
It works fine, except for localized fields, because I use https://django-modeltranslation.readthedocs.io/en/latest/registration.html which add "shadow" fields that are obviously not mapped (they're not present in the model itself, but added through "register")
Is there any way I can tell my model that it owns those fields?
It can find the label
field, but misses the label_fr
and label_en
which are dynamically added at runtime.
Here is the translation.py
:
ANSWER
Answered 2019-Mar-12 at 14:38django-modeltranslation uses a registration approach, described here, which means all models are patched when you launch your django app the first time. After django-modeltranslation is initialised, Post._meta.fields
contains the translated fields text_fr
and text_de
in addition to text
.
Looking at jet-django, it seems a JetAdminModelDescription
is also initialised when the app is launched, the actual model fields are retrieved here using Model._meta.get_fields()
.
So as long as jet-django is initialised after django-modeltranslations, the fields should be also available to JetAdmin.
Make sure you place jet-django after django-modeltranslation in your INSTALLED_APPS
setting and it should work.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jet-django
You can use jet-django like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page