The models module¶
kallithea.model¶
The application’s model objects
This file was forked by the Kallithea project in July 2014. Original author and date, and relevant copyright and licensing information is below: :created_on: Nov 25, 2010 :author: marcink :copyright: (c) 2013 RhodeCode GmbH, and others. :license: GPLv3, see LICENSE.md for more details.
kallithea.model.comment¶
comments model for Kallithea
This file was forked by the Kallithea project in July 2014. Original author and date, and relevant copyright and licensing information is below: :created_on: Nov 11, 2011 :author: marcink :copyright: (c) 2013 RhodeCode GmbH, and others. :license: GPLv3, see LICENSE.md for more details.
kallithea.model.permission¶
permissions model for Kallithea
This file was forked by the Kallithea project in July 2014. Original author and date, and relevant copyright and licensing information is below: :created_on: Aug 20, 2010 :author: marcink :copyright: (c) 2013 RhodeCode GmbH, and others. :license: GPLv3, see LICENSE.md for more details.
- class kallithea.model.permission.PermissionModel[source]¶
Permissions model for Kallithea
kallithea.model.repo¶
Repository model for kallithea
This file was forked by the Kallithea project in July 2014. Original author and date, and relevant copyright and licensing information is below: :created_on: Jun 5, 2010 :author: marcink :copyright: (c) 2013 RhodeCode GmbH, and others. :license: GPLv3, see LICENSE.md for more details.
kallithea.model.repo_group¶
repo group model for Kallithea
This file was forked by the Kallithea project in July 2014. Original author and date, and relevant copyright and licensing information is below: :created_on: Jan 25, 2011 :author: marcink :copyright: (c) 2013 RhodeCode GmbH, and others. :license: GPLv3, see LICENSE.md for more details.
kallithea.model.scm¶
Scm model for Kallithea
This file was forked by the Kallithea project in July 2014. Original author and date, and relevant copyright and licensing information is below: :created_on: Apr 9, 2010 :author: marcink :copyright: (c) 2013 RhodeCode GmbH, and others. :license: GPLv3, see LICENSE.md for more details.
- kallithea.model.scm.AvailableRepoGroupChoices(repo_group_perm_level, extras=())[source]¶
Return group_id,string tuples with choices for all the repo groups where the user has the necessary permissions.
Top level is -1.
- class kallithea.model.scm.ScmModel[source]¶
Generic Scm Model
- commit_change(repo, repo_name, cs, user, ip_addr, author, message, content, f_path)[source]¶
Commit a change to a single file
- Parameters:
repo – a db_repo.scm_instance
- create_nodes(user, ip_addr, repo, message, nodes, parent_cs=None, author=None, trigger_push_hook=True)[source]¶
Commits specified nodes to repo.
- Parameters:
user – Kallithea User object or user_id, the committer
repo – Kallithea Repository object
message – commit message
nodes – mapping {filename:{‘content’:content},…}
parent_cs – parent changeset, can be empty than it’s initial commit
author – author of commit, cna be different that committer only for git
trigger_push_hook – trigger push hooks
- Returns:
new committed changeset
- delete_nodes(user, ip_addr, repo, message, nodes, parent_cs=None, author=None, trigger_push_hook=True)[source]¶
Deletes specified nodes from repo.
- Parameters:
user – Kallithea User object or user_id, the committer
repo – Kallithea Repository object
message – commit message
nodes – mapping {filename:{‘content’:content},…}
parent_cs – parent changeset, can be empty than it’s initial commit
author – author of commit, cna be different that committer only for git
trigger_push_hook – trigger push hooks
- Returns:
new committed changeset after deletion
- get_nodes(repo_name, revision, root_path='/', flat=True)[source]¶
Recursively walk root dir and return a set of all paths found.
- Parameters:
repo_name – name of repository
revision – revision for which to list nodes
root_path – root path to list
flat – return as a list, if False returns a dict with description
- get_repo_groups(groups=None)[source]¶
Return the repo groups the user has access to If no groups are specified, use top level groups.
- get_repo_landing_revs(repo=None)[source]¶
Generates select option with tags branches and bookmarks (for hg only) grouped by type
- Parameters:
repo –
- install_git_hooks(repo, force=False)[source]¶
Creates a kallithea hook inside a git repository
- Parameters:
repo – Instance of VCS repo
force – Overwrite existing non-Kallithea hooks
- mark_for_invalidation(repo_name)[source]¶
Mark caches of this repo invalid in the database.
- Parameters:
repo_name – the repo for which caches should be marked invalid
- pull_changes(repo, username, ip_addr, clone_uri=None)[source]¶
Pull from “clone URL” or fork origin.
kallithea.model.user¶
users model for Kallithea
This file was forked by the Kallithea project in July 2014. Original author and date, and relevant copyright and licensing information is below: :created_on: Apr 9, 2010 :author: marcink :copyright: (c) 2013 RhodeCode GmbH, and others. :license: GPLv3, see LICENSE.md for more details.
kallithea.model.user_group¶
user group model for Kallithea
This file was forked by the Kallithea project in July 2014. Original author and date, and relevant copyright and licensing information is below: :created_on: Oct 1, 2011 :author: nvinot, marcink
