comparison rhodecode/model/__init__.py @ 4116:ffd45b185016 rhodecode-2.2.5-gpl

Imported some of the GPLv3'd changes from RhodeCode v2.2.5. This imports changes between changesets 21af6c4eab3d and 6177597791c2 in RhodeCode's original repository, including only changes to Python files and HTML. RhodeCode clearly licensed its changes to these files under GPLv3 in their /LICENSE file, which states the following: The Python code and integrated HTML are licensed under the GPLv3 license. (See: https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE or http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE for an online copy of that LICENSE file) Conservancy reviewed these changes and confirmed that they can be licensed as a whole to the Kallithea project under GPLv3-only. While some of the contents committed herein are clearly licensed GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the statement above from RhodeCode indicates that they intend GPLv3-only as their license, per GPLv3ยง14 and other relevant sections of GPLv3.
author Bradley M. Kuhn <bkuhn@sfconservancy.org>
date Wed, 02 Jul 2014 19:03:13 -0400
parents a5888ca796b5
children 7e5f8c12a3fc
comparison
equal deleted inserted replaced
4115:8b7294a804a0 4116:ffd45b185016
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 """
3 rhodecode.model.__init__
4 ~~~~~~~~~~~~~~~~~~~~~~~~
5
6 The application's model objects
7
8 :created_on: Nov 25, 2010
9 :author: marcink
10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
11 :license: GPLv3, see COPYING for more details.
12
13
14 :example:
15
16 .. code-block:: python
17
18 from paste.deploy import appconfig
19 from pylons import config
20 from sqlalchemy import engine_from_config
21 from rhodecode.config.environment import load_environment
22
23 conf = appconfig('config:development.ini', relative_to = './../../')
24 load_environment(conf.global_conf, conf.local_conf)
25
26 engine = engine_from_config(config, 'sqlalchemy.')
27 init_model(engine)
28 # RUN YOUR CODE HERE
29
30 """
31 # This program is free software: you can redistribute it and/or modify 2 # This program is free software: you can redistribute it and/or modify
32 # it under the terms of the GNU General Public License as published by 3 # it under the terms of the GNU General Public License as published by
33 # the Free Software Foundation, either version 3 of the License, or 4 # the Free Software Foundation, either version 3 of the License, or
34 # (at your option) any later version. 5 # (at your option) any later version.
35 # 6 #
38 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39 # GNU General Public License for more details. 10 # GNU General Public License for more details.
40 # 11 #
41 # You should have received a copy of the GNU General Public License 12 # You should have received a copy of the GNU General Public License
42 # along with this program. If not, see <http://www.gnu.org/licenses/>. 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 """
15 rhodecode.model.__init__
16 ~~~~~~~~~~~~~~~~~~~~~~~~
17
18 The application's model objects
19
20 :created_on: Nov 25, 2010
21 :author: marcink
22 :copyright: (c) 2013 RhodeCode GmbH.
23 :license: GPLv3, see LICENSE for more details.
24
25
26 :example:
27
28 .. code-block:: python
29
30 from paste.deploy import appconfig
31 from pylons import config
32 from sqlalchemy import engine_from_config
33 from rhodecode.config.environment import load_environment
34
35 conf = appconfig('config:development.ini', relative_to = './../../')
36 load_environment(conf.global_conf, conf.local_conf)
37
38 engine = engine_from_config(config, 'sqlalchemy.')
39 init_model(engine)
40 # RUN YOUR CODE HERE
41
42 """
43
43 44
44 import logging 45 import logging
45 from rhodecode.model import meta 46 from rhodecode.model import meta
46 from rhodecode.lib.utils2 import safe_str, obfuscate_url_pw 47 from rhodecode.lib.utils2 import safe_str, obfuscate_url_pw
47 48
128 """ 129 """
129 from rhodecode.model.db import Permission 130 from rhodecode.model.db import Permission
130 return self._get_instance(Permission, permission, 131 return self._get_instance(Permission, permission,
131 callback=Permission.get_by_key) 132 callback=Permission.get_by_key)
132 133
133 def get_all(self): 134 @classmethod
135 def get_all(cls):
134 """ 136 """
135 Returns all instances of what is defined in `cls` class variable 137 Returns all instances of what is defined in `cls` class variable
136 """ 138 """
137 return self.cls.getAll() 139 return cls.cls.getAll()