Giter VIP home page Giter VIP logo

django-jsonsuit's People

Contributors

ad-m avatar exside avatar tooreht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

django-jsonsuit's Issues

example application

The widget looks very useful but it is very difficult to understand how to use it w/o working examples.

JSONSuit not working in admin form when no-change permissions in place

  • django-jsonsuit version: 0.4.4
  • Django version: 3.0.5
  • Python version: 3.8.1
  • Operating System: Mac Os Catalina

Description

Disabling change permissions for the admin user in my ModelAdmin results in JSONSuit stopping to work.

What I Did

I tried setting up my fields with either the JSONSuit or the ReadOnlyJSONSuit widgets.

There is a workaround which involves faking the change form layout, but for obvious reasons I would avoid going down that path, if possible.

do not accept any parameter name except "data"

  • django-jsonsuit version: 0.4.2
  • Django version: 1,11,2 final
  • Python version: 3.6
  • Operating System: windows

Description

do not accept any parameter name except "data"
{% jsonsuit data %}

What I Did

views.py
...
return render(request, 'sensor_list.html', {'sensor': sensorTypeModel.jsonTemplate})
...
expect:
in file sensor_list.html
{% jsonsuit sensor %} is working

but I have error
is not JSON serializable

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

Multiple Forms Per Page Unsupported

  • django-jsonsuit version: 0.4.4
  • Django version: 3.1.7
  • Python version: 3.8.5
  • Operating System: WSL Ubuntu

Description

When trying to add multiple instances of the same form to a page, controls from a JSON field on any instance of the form operate the same field on the first instance of a form.

Steps to Reproduce

  1. Create a model class having a corresponding form with a JSONSuit field.
  2. Pass an array of form instances representing said model class to a template and render them using a loop, e.g.
{% for form in model_forms %}
    {{ form }}
{% endfor %}
  1. Attempt to use the controls on an instance of the JSONSuit field.

What I Expected

When clicking on "Raw", I expect it to switch that field to raw mode.

What Actually Happened

When clicking on "Raw", the corresponding field on the first instance of the form on that page switched to raw mode.

Initial Findings

Right now the code for JsonSuit assumes the field will have an id of id_{field.name}, which is generally correct. However, in the case of more than one instance of the form, it selects the first element matching that ID, which will be on the first form.

Generally you could mitigate this by changing the auto_id parameter on the Form object, which alters the ID generated for all fields (its default value is id_%s). However, because JSONSuit doesn't use this when calculating the ID it expects for a given field, changing that value will break JSONSuit entirely.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.