Comments (4)
from my code here
import asyncio
from pocketbase import PocketBase
client = PocketBase('http://127.0.0.1:8090')
admin_data = client.admins.auth_with_password("[email protected]", "admin12345")
result = client.collection("fletSample").get_full_list()
for x in result:
print(x)
from pocketbase.
I'm not 100% sure if you can get the content of every field without knowing what fields an element of result
will contain (someone will correct me). You'd probably need to extend the class BaseModel
and add class variables for your needs (e.g. the fields in your collection in pocketbase).
For me it worked, when writing:
for x in result:
print(x.id)
Where id
can be the name of the field in your collection.
from pocketbase.
client = PocketBase('http://127.0.0.1:8090/')
admin_data = client.admins.auth_with_password("[[email protected]](mailto:[email protected])", "admin12345")
result = client.collection("fletSample").get_full_list()
for res in result:
print(res.__dict__)
from pocketbase.
Figured it out, here's an example:
data = db.collection("data").get_full_list()
jsonified_data = [vars(row) for row in data]
print(jsonified_data)
Just note that if you wanted to use json.dumps to get indents on the terminal it'll return a TypeError: Object of type datetime is not JSON serializable
from the created
and updated
columns at the very least.
from pocketbase.
Related Issues (20)
- AdminService delete + update methods do not work
- version 0.8.2 actually isn't in pypi HOT 1
- Typo in function argument for auth_with_oauth2 method
- TypeError when expanding relations. HOT 6
- Pocketbase v0.18 api change breaks SchemaField unmarshaling
- Subscribe example HOT 2
- Remove class variables HOT 3
- Incorrect last pocketbase version? HOT 1
- Support for protected files HOT 3
- Back-relation expand HOT 4
- log service broken with pocketbase >=v0.20.0
- Issues deleting keys while iterating a list of dictionary HOT 2
- TypeError() raise when calling `client.collections.get_full_list()` HOT 2
- SSE thread will die silently HOT 1
- How to use the transaction, did not find the corresponding transaction package interface HOT 1
- .collections.get_full_list() error HOT 4
- [help-wanted] How can I create a Collection API hook? HOT 2
- [Help] How to get record data ... ? HOT 2
- [Help] How to check if token is valid or has expired HOT 1
- Support backup API HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pocketbase.