Store user access token for one-time-login
Project description
Odoo REST Framework
Version : 1.2.0
Package :
pip3 install odoo-rest-framework
package link :
https://pypi.org/project/odoo-rest-framework/
github link :
https://github.com/HanZawNyein/odoo-rest-framework.git
Author :
Han Zaw Nyein
Author_email:
hanzawnyineonline@gmail.com
Description :
Store user access token for one-time-login
Controller Code Example
from odoo import http
from .odoo_rest_framework import (
login_required,
jwt_http,
fields_extractor,
read_serializer
)
from odoo.http import request
class Testing(http.Controller):
@login_required(route='/api/testing/', csrf=False, methods=['GET'])
def testing(self, limit=5, offset=1, *args, **kwargs):
model_res_partner = request.env['res.partner']
# all_fields = fields_extractor(model_res_partner)
all_partner = model_res_partner.search_read([], fields=['id','name'], limit=limit, offset=offset)
all_partner = read_serializer(all_partner)
return jwt_http.response(data=all_partner, message='Holidays')
Response Example
{
"success": true,
"message": "Holidays",
"data": [
{
"id": 37,
"name": "Brandon Freeman"
},
{
"id": 44,
"name": "Colleen Diaz"
}
]
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for odoo_rest_framework-1.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a13cd3f973f18e0b61f7b47ffcdad243b6035ac1150f1afc61117c00e201d9 |
|
MD5 | 75cef05f56d4dc3ee450770d36886769 |
|
BLAKE2b-256 | 9481710d0d2fd9211efff84fbebf0d9bd6c3703077f83dde0065fb2faefde2a9 |