FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

python-gitlab/docs/gl_objects/badges.rst at jlvillal/testing · python-gitlab/python-gitlab · GitHub

Repository navigation

Latest commit

 

History

History
52 lines (33 loc) · 1.03 KB

File metadata and controls

52 lines (33 loc) · 1.03 KB

Badges

Badges can be associated with groups and projects.

Reference

Examples

List badges:

badges = group_or_project.badges.list()

Get a badge:

badge = group_or_project.badges.get(badge_id)

Create a badge:

badge = group_or_project.badges.create({'link_url': link, 'image_url': image_link})

Update a badge:

badge.image_link = new_link
badge.save()

Delete a badge:

badge.delete()

Render a badge (preview the generate URLs):

output = group_or_project.badges.render(link, image_link)
print(output['rendered_link_url'])
print(output['rendered_image_url'])

Back | FazBrowse Home | New Git URL