Giter Club home page Giter Club logo

Comments (6)

jcushman avatar jcushman commented on July 19, 2024

(I just edited the SerializedObjectWidget code to remove a pointless serialize-deserialize step in DjangoJSONEncoder, which was messing up sub-sub-objects.)

from djangotoolbox.

jonashaag avatar jonashaag commented on July 19, 2024

Any opinions from other contributors? I don't have any (yet).

from djangotoolbox.

ReneVolution avatar ReneVolution commented on July 19, 2024

Hey, first of all thanks for sharing this. As this looked like it would pretty much solve my trouble with the ListField i tried to implement it, but ...

i run into an issue with the Field part in
defaults = {'form_class': Field, 'widget': SerializedObjectWidget}

If i use it as stated i get:
'global name 'Field' is not defined' -> which is truely understandable

then i thought i need to define the Field-Type i'm using inside the ListField, so i tried:

defaults = {'form_class': EmbeddedModelField, 'widget': SerializedObjectWidget}

with the following result:
'init() got an unexpected keyword argument 'widget''

As a beginner here i would be grateful if you could point me into a direction to solve this.

Thanks a lot,
Reen

from djangotoolbox.

ReneVolution avatar ReneVolution commented on July 19, 2024

Oh no .... damn it ..... feeling like the ultra noob ;)

Just fixed it ....

it was just an import missing in my models.py:

from django.forms import Field

Thank you really for sharing your code ...

Best,
Reen

from djangotoolbox.

mtiller avatar mtiller commented on July 19, 2024

FWIW, I think this should be the default behavior for DictField fields. This then opens up the admin interface by default and enables other things like djangorestframework to work properly.

from djangotoolbox.

koleror avatar koleror commented on July 19, 2024

Thanks for sharing this code! Very helpful!

from djangotoolbox.

Related Issues (20)

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.