Added migration for license field, resolved conflict in db/sql/models.py
[mediagoblin.git] / mediagoblin / tools / licenses.py
1 # GNU MediaGoblin -- federated, autonomous media hosting
2 # Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 SUPPORTED_LICENSES = {
18 "": {
19 "name": "No license specified",
20 "abbreviation": "All rights reserved"
21 },
22 "http://creativecommons.org/licenses/by/3.0/": {
23 "name": "Creative Commons Attribution Unported 3.0",
24 "abbreviation": "CC BY 3.0"
25 },
26 "http://creativecommons.org/licenses/by-sa/3.0": {
27 "name": "Creative Commons Attribution-ShareAlike Unported 3.0",
28 "abbreviation": "CC BY-SA 3.0"
29 },
30 "http://creativecommons.org/licenses/by-nd/3.0": {
31 "name": "Creative Commons Attribution-NoDerivs 3.0 Unported",
32 "abbreviation": "CC BY-ND 3.0"
33 },
34 "http://creativecommons.org/licenses/by-nc/3.0": {
35 "name": "Creative Commons Attribution-NonCommercial Unported 3.0",
36 "abbreviation": "CC BY-NC 3.0"
37 },
38 "http://creativecommons.org/licenses/by-nc-sa/3.0": {
39 "name": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported",
40 "abbreviation": "CC BY-NC-SA 3.0"
41 },
42 "http://creativecommons.org/licenses/by-nc-nd/3.0": {
43 "name": "Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported",
44 "abbreviation": "CC BY-NC-ND 3.0"
45 },
46 "http://creativecommons.org/publicdomain/zero/1.0/": {
47 "name": "Creative Commons CC0 1.0 Universal",
48 "abbreviation": "CC0 1.0"
49 },
50 "http://creativecommons.org/publicdomain/mark/1.0/": {
51 "name": "Public Domain",
52 "abbreviation": "Public Domain"
53 },
54 }
55
56 def licenses_as_choices():
57 license_list = []
58
59 for uri, data in SUPPORTED_LICENSES.items():
60 license_list.append((uri, data["abbreviation"]))
61
62 return license_list