Coder Social home page Coder Social logo

Api.py Label about wekan HOT 7 CLOSED

xator91 avatar xator91 commented on June 24, 2024
Api.py Label

from wekan.

Comments (7)

xet7 avatar xet7 commented on June 24, 2024

@xator91

WeKan API docs are at https://wekan.github.io/api/

api.py is here https://github.com/wekan/wekan/blob/main/api.py

API code is here https://github.com/wekan/wekan/tree/main/models

You can add way to add label to api.py

Here is info how to make pull request:

https://github.com/wekan/wekan/wiki/Emoji

from wekan.

xator91 avatar xator91 commented on June 24, 2024

Tried, but doesnt work:

`if arguments == 3:

if sys.argv[1] == 'cardsbyswimlane':
    # ------- RETRIEVE CARDS BY SWIMLANE ID START -----------
    boardid = sys.argv[2]
    swimlaneid = sys.argv[3]
    cardsbyswimlane = wekanurl + apiboards + boardid + s + sws + s + swimlaneid + s + cs
    headers = {'Accept': 'application/json', 'Authorization': 'Bearer {}'.format(apikey)}
    print("=== CARDS BY SWIMLANE ID ===\n")
    body = requests.get(cardsbyswimlane, headers=headers)
    data = body.json()

    for card in data:
        label_ids = card.get('labelIds', [])
        print(f"Card ID: {card['_id']}")
        print(f"Title: {card['title']}")
        print(f"Description: {card['description']}")
        print(f"List ID: {card['listId']}")
        
        if label_ids:
            print(f"Label IDs: {label_ids}")
        else:
            print("No Label IDs")

        print("-----")`

Im trying to retrieve id of labels:

Card ID: mkMHyYQAMQMydxo8j
Title: w
Description:
List ID: 7ffkpzgLSD7nRgad4
No Label IDs

from wekan.

xet7 avatar xet7 commented on June 24, 2024

@xator91

Add some lines to print what happens at each step. Check that there is API code at models.

from wekan.

xator91 avatar xator91 commented on June 24, 2024

@xator91

Add some lines to print what happens at each step. Check that there is API code at models.

=== CARDS BY SWIMLANE ID ===

URL: http://localhost:3001/api/boards/4wdoc4JnJqMDMfz5r/swimlanes/JTwakM9LyXQRbMHmn/cards
Status Code: 200
Data: [{"_id":"j7qANvZEbu5QbzByP","title":"130 / 60/2200 2,2 KW","description":"test","listId":"7ffkpzgLSD7nRgad4","assignees":[]}
,{"_id":"u6cCy3DNarTN9pw7v","title":"130 / 60/2200 2,2 KW","description":"test","listId":"7ffkpzgLSD7nRgad4","assignees":[]}
,{"_id":"mkMHyYQAMQMydxo8j","title":"w","description":"","listId":"7ffkpzgLSD7nRgad4","assignees":[]}

from wekan.

xator91 avatar xator91 commented on June 24, 2024

Maybe i have to add a way to add "card id" to retrieve everything from a card?

from wekan.

xet7 avatar xet7 commented on June 24, 2024

@xator91

Maybe, if there is no API for that yet.

from wekan.

xet7 avatar xet7 commented on June 24, 2024

@xator91

There is API for getting info from card:

https://wekan.github.io/api/v7.30/#get_card

So you could add to api.py a way to call that API.

from wekan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.