How to get all data from my Model?
See original GitHub issueMy class looks like this:
class WaitPayment(BaseModel):
txn_id = TextField(unique=True, primary_key=True)
discord_id = TextField()
ms_expires = DecimalField()
and I want to recieve all of its records as a dict. However, when I use WaitPayment.select()
or WaitPayment.select().dicts()
, it returns:
SELECT "t1"."txn_id", "t1"."discord_id", "t1"."ms_expires" FROM "waitpayment" AS "t1"
in the terminal, which is not what I want. I do not want the sql query, I want the result. Any help? Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to get all data from a Eloquent Model with it's relations?
Try placing a company_id column in your users table and fill the column with the respective company id. – adam. Nov 10, 2020...
Read more >Get all data from a model - Odoo
Hi i try to get all row of a model in odoo 9 But, it returns only 290 rows of total 310 rows...
Read more >Retrieving Your Data - 2.x - CakePHP Cookbook
Find is the multifunctional workhorse of all model data-retrieval functions. $type can be 'all' , 'first' , 'count' ...
Read more >Model instance reference - Django documentation
Model instance reference¶. This document describes the details of the Model API. It builds on the material presented in the model and database...
Read more >Introduction to the Data Model and ORM - SilverStripe docs
All data tables in Silverstripe CMS are defined as subclasses of DataObject. ... this will force the data model to fetch all records...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://docs.python.org/3/library/functions.html#func-list
To answer my own question, yes you must iterate. @coleifer are there any ways of not iterating to save time? like recieving an array of classes instead of just something to iterate upon. Thanks. And please give some explanation rather than just sending a link, thank you.