Skip to main content

Store user access token for one-time-login

Project description

Odoo REST Framework

Version : 1.1.7

Package :

pip 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odoo_rest_framework-1.1.7.tar.gz (7.4 kB view details)

Uploaded Source

File details

Details for the file odoo_rest_framework-1.1.7.tar.gz.

File metadata

  • Download URL: odoo_rest_framework-1.1.7.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for odoo_rest_framework-1.1.7.tar.gz
Algorithm Hash digest
SHA256 b9829ce38cd61df99592b5d6efb07ea3069b8f83cc38c560286e19898359e060
MD5 8bd68e039db07dac63421149a224adc9
BLAKE2b-256 6c59269f89904da98baebaeff73320e63b8bc1636b3eff19b391b6e5935167e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page