GithubHelp home page GithubHelp logo

Comments (4)

rollebolle123 avatar rollebolle123 commented on May 29, 2024 1

No, sorry, I am not trying to be condescending.
And maybe I did not understand the original problem. Aaaaand, I had no idea you could put quotes around types to forward declare them. Then it makes sense to me :D

from odmantic.

rollebolle123 avatar rollebolle123 commented on May 29, 2024

But, that makes sense? :O The embedded model should be defined first so a definition exists?

Also:
class Bar(Model):
bar: "Foo" <------ should lose the quotation marks?

aaaand
[Index(asc(Bar.bar.foo)] <--- missing a parentheses :D :
[Index(asc(Bar.bar.foo))]

from odmantic.

duhby avatar duhby commented on May 29, 2024

Well as I mentioned, it doesn't matter if the quotations are there or not for both cases, and I didn't test the example code specifically so I missed the parentheses. I just think it should be specified in the documentation because it's not obvious that it should be defined before (other odm libraries don't have this behavior).

When you say "the embedded model should be defined first so a definition exists," that should (intuitively) only be necessary for the type hint if you want to define it without quotations. The reason I say it's not intuitive or obvious is because by the time any code is run regarding creating indexes or creating search queries, both of the models have already been defined.

I'm not saying the behavior is bad, it just needs to be clarified somewhere, and it might be unintended.

from odmantic.

duhby avatar duhby commented on May 29, 2024

Also, what's with the unnecessary condescension? You clearly didn't take the time to fully understand the original post.

from odmantic.

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.