Merge lp:~dholbach/developer-ubuntu-com/store-admin into lp:developer-ubuntu-com

Proposed by Daniel Holbach
Status: Merged
Approved by: David Callé
Approved revision: 208
Merged at revision: 205
Proposed branch: lp:~dholbach/developer-ubuntu-com/store-admin
Merge into: lp:developer-ubuntu-com
Diff against target: 163 lines (+60/-29)
7 files modified
store_data/admin.py (+23/-18)
store_data/cms_plugins.py (+3/-2)
store_data/migrations/0002_make_screenshot_optional.py (+19/-0)
store_data/models.py (+13/-1)
store_data/tests.py (+0/-3)
store_data/urls.py (+2/-2)
store_data/views.py (+0/-3)
To merge this branch: bzr merge lp:~dholbach/developer-ubuntu-com/store-admin
Reviewer Review Type Date Requested Status
Ubuntu App Developer site developers Pending
Review via email: mp+290283@code.launchpad.net
To post a comment you must log in.
208. By Daniel Holbach

sort alphabetically

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'store_data/admin.py'
2--- store_data/admin.py 2015-06-29 09:17:29 +0000
3+++ store_data/admin.py 2016-03-29 08:41:51 +0000
4@@ -1,22 +1,27 @@
5-from .models import Release, Architecture, GadgetSnap
6+from .models import (
7+ Architecture,
8+ GadgetSnap,
9+ Release,
10+ ScreenshotURL,
11+)
12 from django.contrib import admin
13
14-# Register your models here.
15-
16-
17-class ReleaseAdmin(admin.ModelAdmin):
18- list_display = ('name',)
19- search_fields = ('name',)
20-admin.site.register(Release, ReleaseAdmin)
21-
22-
23+
24+@admin.register(Architecture)
25 class ArchitectureAdmin(admin.ModelAdmin):
26- list_display = ('name',)
27- search_fields = ('name',)
28-admin.site.register(Architecture, ArchitectureAdmin)
29-
30-
31+ pass
32+
33+
34+@admin.register(GadgetSnap)
35 class GadgetSnapAdmin(admin.ModelAdmin):
36- list_display = ('name',)
37- search_fields = ('name', 'alias', 'publisher')
38-admin.site.register(GadgetSnap, GadgetSnapAdmin)
39+ pass
40+
41+
42+@admin.register(Release)
43+class ReleaseAdmin(admin.ModelAdmin):
44+ pass
45+
46+
47+@admin.register(ScreenshotURL)
48+class ScreenshotURLAdmin(admin.ModelAdmin):
49+ pass
50
51=== modified file 'store_data/cms_plugins.py'
52--- store_data/cms_plugins.py 2015-11-10 11:46:15 +0000
53+++ store_data/cms_plugins.py 2016-03-29 08:41:51 +0000
54@@ -6,7 +6,7 @@
55
56
57 class GadgetSnapListPluginLarge(CMSPluginBase):
58- # Keeping the name short to be able to differentiate them
59+ # Keeping the name short to be able to differentiate them
60 # in the editor dropdown
61 name = _("Snap list - Gadget")
62 render_template = "gadget_snap_list.html"
63@@ -20,8 +20,9 @@
64
65 plugin_pool.register_plugin(GadgetSnapListPluginLarge)
66
67+
68 class GadgetSnapListPluginSmall(CMSPluginBase):
69- # Keeping the name short to be able to differentiate them
70+ # Keeping the name short to be able to differentiate them
71 # in the editor dropdown
72 name = _("Snap shortlist - Gadget")
73 render_template = "gadget_snap_shortlist.html"
74
75=== added file 'store_data/migrations/0002_make_screenshot_optional.py'
76--- store_data/migrations/0002_make_screenshot_optional.py 1970-01-01 00:00:00 +0000
77+++ store_data/migrations/0002_make_screenshot_optional.py 2016-03-29 08:41:51 +0000
78@@ -0,0 +1,19 @@
79+# -*- coding: utf-8 -*-
80+from __future__ import unicode_literals
81+
82+from django.db import migrations, models
83+
84+
85+class Migration(migrations.Migration):
86+
87+ dependencies = [
88+ ('store_data', '0001_initial'),
89+ ]
90+
91+ operations = [
92+ migrations.AlterField(
93+ model_name='gadgetsnap',
94+ name='screenshot_url',
95+ field=models.ManyToManyField(to='store_data.ScreenshotURL', blank=True),
96+ ),
97+ ]
98
99=== modified file 'store_data/models.py'
100--- store_data/models.py 2015-11-10 14:52:15 +0000
101+++ store_data/models.py 2016-03-29 08:41:51 +0000
102@@ -4,14 +4,23 @@
103 class Release(models.Model):
104 name = models.CharField(max_length=25)
105
106+ def __str__(self):
107+ return self.name
108+
109
110 class Architecture(models.Model):
111 name = models.CharField(max_length=10)
112
113+ def __str__(self):
114+ return self.name
115+
116
117 class ScreenshotURL(models.Model):
118 url = models.URLField(blank=True)
119
120+ def __str__(self):
121+ return self.url
122+
123
124 class GadgetSnap(models.Model):
125 icon_url = models.URLField(blank=True)
126@@ -27,5 +36,8 @@
127 architecture = models.ManyToManyField(Architecture)
128 last_updated = models.DateTimeField()
129 description = models.TextField(max_length=5000)
130- screenshot_url = models.ManyToManyField(ScreenshotURL)
131+ screenshot_url = models.ManyToManyField(ScreenshotURL, blank=True)
132 website = models.URLField(blank=True)
133+
134+ def __str__(self):
135+ return self.name
136
137=== removed file 'store_data/tests.py'
138--- store_data/tests.py 2015-06-23 09:23:50 +0000
139+++ store_data/tests.py 1970-01-01 00:00:00 +0000
140@@ -1,3 +0,0 @@
141-from django.test import TestCase
142-
143-# Create your tests here.
144
145=== modified file 'store_data/urls.py'
146--- store_data/urls.py 2015-06-23 09:23:50 +0000
147+++ store_data/urls.py 2016-03-29 08:41:51 +0000
148@@ -1,5 +1,5 @@
149+from django.contrib import admin
150 from django.contrib.staticfiles.urls import staticfiles_urlpatterns
151+
152 urlpatterns = staticfiles_urlpatterns()
153-
154-from django.contrib import admin
155 admin.autodiscover()
156
157=== removed file 'store_data/views.py'
158--- store_data/views.py 2015-06-23 09:23:50 +0000
159+++ store_data/views.py 1970-01-01 00:00:00 +0000
160@@ -1,3 +0,0 @@
161-from django.shortcuts import render
162-
163-# Create your views here.

Subscribers

People subscribed via source and target branches