The models Module

rhodecode.model.__init__

The application’s model objects

created_on:

Nov 25, 2010

author:

marcink

copyright:
  1. 2009-2010 Marcin Kuzminski <marcin@python-works.com>
license:

GPLv3, see COPYING for more details.

example:
from paste.deploy import appconfig
from pylons import config
from sqlalchemy import engine_from_config
from rhodecode.config.environment import load_environment

conf = appconfig('config:development.ini', relative_to = './../../')
load_environment(conf.global_conf, conf.local_conf)

engine = engine_from_config(config, 'sqlalchemy.')
init_model(engine)
# RUN YOUR CODE HERE
class rhodecode.model.BaseModel(sa=None)[source]

Base Model for all RhodeCode models, it adds sql alchemy session into instance of model

Parameters:sa – If passed it reuses this session instead of creating a new one
rhodecode.model.init_model(engine)[source]

Initializes db session, bind the engine with the metadata, Call this before using any of the tables or classes in the model, preferably once in application start

Parameters:engine – engine to bind to

rhodecode.model.permission

permissions model for RhodeCode

created_on:

Aug 20, 2010

author:

marcink

copyright:
  1. 2009-2010 Marcin Kuzminski <marcin@python-works.com>
license:

GPLv3, see COPYING for more details.

class rhodecode.model.permission.PermissionModel(sa=None)[source]

Permissions model for RhodeCode

get_permission(permission_id, cache=False)[source]

Get’s permissions by id

Parameters:
  • permission_id – id of permission to get from database
  • cache – use Cache for this query
get_permission_by_name(name, cache=False)[source]

Get’s permissions by given name

Parameters:
  • name – name to fetch
  • cache – Use cache for this query

rhodecode.model.repo

Repository model for rhodecode

created_on:

Jun 5, 2010

author:

marcink

copyright:
  1. 2009-2011 Marcin Kuzminski <marcin@python-works.com>
license:

GPLv3, see COPYING for more details.

rhodecode.model.scm

Scm model for RhodeCode

created_on:

Apr 9, 2010

author:

marcink

copyright:
  1. 2009-2010 Marcin Kuzminski <marcin@python-works.com>
license:

GPLv3, see COPYING for more details.

class rhodecode.model.scm.ScmModel(sa=None)[source]

Generic Scm Model

get(repo_name, invalidation_list=None)[source]

Get’s repository from given name, creates BackendInstance and propagates it’s data from database with all additional information

Parameters:
  • repo_name
  • invalidation_list – if a invalidation list is given the get method should not manually check if this repository needs invalidation and just invalidate the repositories in list
get_repos(all_repos=None)[source]

Get all repos from db and for each repo create it’s backend instance. and fill that backed with information from database

Parameters:all_repos – give specific repositories list, good for filtering
mark_for_invalidation(repo_name)[source]

Puts cache invalidation task into db for further global cache invalidation

Parameters:repo_name – this repo that should invalidation take place
repo_scan(repos_path, baseui)[source]

Listing of repositories in given path. This path should not be a repository itself. Return a dictionary of repository objects

Parameters:
  • repos_path – path to directory containing repositories
  • baseui – baseui instance to instantiate MercurialRepostitory with

rhodecode.model.user

users model for RhodeCode

created_on:

Apr 9, 2010

author:

marcink

copyright:
  1. 2009-2011 Marcin Kuzminski <marcin@python-works.com>
license:

GPLv3, see COPYING for more details.

Support my development effort.

Table Of Contents

Previous topic

API Reference

This Page