question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhance the TypeHints to return actual Models and not ormar.Model

See original GitHub issue

As described in #111 QuerySet methods should actually return inferred Model subclasses and not the main ormar.Model.

Since I am not an expert in complex python typing any help appreciated.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
collerekcommented, Mar 23, 2021

@aliakhtar - in 0.10.1 I added get_or_none()

0reactions
aliakhtarcommented, Mar 23, 2021

That’s awesome, and very fast. Thanks!

Almost wish you hadn’t done it so I could send a PR 😛

Read more comments on GitHub >

github_iconTop Results From Across the Web

Models - ormar - GitHub Pages
By defining an ormar Model you get corresponding Pydantic model as well as ... and do not pass actual value in request you...
Read more >
QuerySet operations returns Sequence instead of List #120
The QuerySet operations return value is Sequence["Model"] even ... ormar.models.mixins.merge_mixin.py ==> merge_instances_list class method.
Read more >
How do I type hint a method with the type of the enclosing class?
Since Python still is a dynamically typed language so no type-checking is done ... inherited type hints of the return # https://stackoverflow.com/a/64938978 ...
Read more >
InCoder: A Generative Model for Code Infilling and Synthesis | DeepAI
Most current image captioning models typically generate captions from le. ... non-None return type hints, and that were not included in our model's...
Read more >
What's New In Python 3.7 — Python 3.11.1 documentation
The advent of type hints in Python uncovered two glaring usability issues with the ... of the existing TLS API will be no-op...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found