Giter Site home page Giter Site logo

Comments (3)

stevearc avatar stevearc commented on August 28, 2024

There's two things going on here, a documentation bug and an API bug. Right now, Flywheel intentionally disables certain functionality for private fields (starting with '_'). The first problem is that this isn't documented, and it really should be. The second problem is that it's not intuitive and should behave better. That's just poor design on my part.

I'm making a change at the moment which will fix your issue and then I'll update the docs accordingly. I should have this in today and I'll release 0.1.2 some time tomorrow. If you need the model working before then, you can temporarily remove the leading underscore from all the fields. Thanks for finding this issue!

from flywheel.

stevearc avatar stevearc commented on August 28, 2024

0.1.2 is released on pypi.

Just to clear up all the edge cases, your current model should now work. Fields will not work if they begin with a double-underscore or end with a single underscore.

class MyModel(Model):
    f1 = Field()  # this is fine
    _f2 = Field()  # this is also fine
    f3_ = Field()  # this will throw an error with a reasonable message
    __f3 = Field()  # this will also throw an error with a reasonable message

If you are using undeclared fields, any field that begins or ends with an underscore will not be persisted to Dynamo.

instance.other_field = "this field will be saved to dynamo"
instance._foobar = "this field will not"
instance.foobar_ = "neither will this"

from flywheel.

eprparadocs avatar eprparadocs commented on August 28, 2024

Thanks for the information. I looked at the dynamodb spec for column names and thought they were OK.

Peace
Chuck Wegrzyn

Sent from Yahoo Mail on Android

from flywheel.

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.