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
=== modified file 'store_data/admin.py'
--- store_data/admin.py 2015-06-29 09:17:29 +0000
+++ store_data/admin.py 2016-03-29 08:41:51 +0000
@@ -1,22 +1,27 @@
1from .models import Release, Architecture, GadgetSnap1from .models import (
2 Architecture,
3 GadgetSnap,
4 Release,
5 ScreenshotURL,
6)
2from django.contrib import admin7from django.contrib import admin
38
4# Register your models here.9
510@admin.register(Architecture)
6
7class ReleaseAdmin(admin.ModelAdmin):
8 list_display = ('name',)
9 search_fields = ('name',)
10admin.site.register(Release, ReleaseAdmin)
11
12
13class ArchitectureAdmin(admin.ModelAdmin):11class ArchitectureAdmin(admin.ModelAdmin):
14 list_display = ('name',)12 pass
15 search_fields = ('name',)13
16admin.site.register(Architecture, ArchitectureAdmin)14
1715@admin.register(GadgetSnap)
18
19class GadgetSnapAdmin(admin.ModelAdmin):16class GadgetSnapAdmin(admin.ModelAdmin):
20 list_display = ('name',)17 pass
21 search_fields = ('name', 'alias', 'publisher')18
22admin.site.register(GadgetSnap, GadgetSnapAdmin)19
20@admin.register(Release)
21class ReleaseAdmin(admin.ModelAdmin):
22 pass
23
24
25@admin.register(ScreenshotURL)
26class ScreenshotURLAdmin(admin.ModelAdmin):
27 pass
2328
=== modified file 'store_data/cms_plugins.py'
--- store_data/cms_plugins.py 2015-11-10 11:46:15 +0000
+++ store_data/cms_plugins.py 2016-03-29 08:41:51 +0000
@@ -6,7 +6,7 @@
66
77
8class GadgetSnapListPluginLarge(CMSPluginBase):8class GadgetSnapListPluginLarge(CMSPluginBase):
9 # Keeping the name short to be able to differentiate them 9 # Keeping the name short to be able to differentiate them
10 # in the editor dropdown10 # in the editor dropdown
11 name = _("Snap list - Gadget")11 name = _("Snap list - Gadget")
12 render_template = "gadget_snap_list.html"12 render_template = "gadget_snap_list.html"
@@ -20,8 +20,9 @@
2020
21plugin_pool.register_plugin(GadgetSnapListPluginLarge)21plugin_pool.register_plugin(GadgetSnapListPluginLarge)
2222
23
23class GadgetSnapListPluginSmall(CMSPluginBase):24class GadgetSnapListPluginSmall(CMSPluginBase):
24 # Keeping the name short to be able to differentiate them 25 # Keeping the name short to be able to differentiate them
25 # in the editor dropdown26 # in the editor dropdown
26 name = _("Snap shortlist - Gadget")27 name = _("Snap shortlist - Gadget")
27 render_template = "gadget_snap_shortlist.html"28 render_template = "gadget_snap_shortlist.html"
2829
=== added file 'store_data/migrations/0002_make_screenshot_optional.py'
--- store_data/migrations/0002_make_screenshot_optional.py 1970-01-01 00:00:00 +0000
+++ store_data/migrations/0002_make_screenshot_optional.py 2016-03-29 08:41:51 +0000
@@ -0,0 +1,19 @@
1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals
3
4from django.db import migrations, models
5
6
7class Migration(migrations.Migration):
8
9 dependencies = [
10 ('store_data', '0001_initial'),
11 ]
12
13 operations = [
14 migrations.AlterField(
15 model_name='gadgetsnap',
16 name='screenshot_url',
17 field=models.ManyToManyField(to='store_data.ScreenshotURL', blank=True),
18 ),
19 ]
020
=== modified file 'store_data/models.py'
--- store_data/models.py 2015-11-10 14:52:15 +0000
+++ store_data/models.py 2016-03-29 08:41:51 +0000
@@ -4,14 +4,23 @@
4class Release(models.Model):4class Release(models.Model):
5 name = models.CharField(max_length=25)5 name = models.CharField(max_length=25)
66
7 def __str__(self):
8 return self.name
9
710
8class Architecture(models.Model):11class Architecture(models.Model):
9 name = models.CharField(max_length=10)12 name = models.CharField(max_length=10)
1013
14 def __str__(self):
15 return self.name
16
1117
12class ScreenshotURL(models.Model):18class ScreenshotURL(models.Model):
13 url = models.URLField(blank=True)19 url = models.URLField(blank=True)
1420
21 def __str__(self):
22 return self.url
23
1524
16class GadgetSnap(models.Model):25class GadgetSnap(models.Model):
17 icon_url = models.URLField(blank=True)26 icon_url = models.URLField(blank=True)
@@ -27,5 +36,8 @@
27 architecture = models.ManyToManyField(Architecture)36 architecture = models.ManyToManyField(Architecture)
28 last_updated = models.DateTimeField()37 last_updated = models.DateTimeField()
29 description = models.TextField(max_length=5000)38 description = models.TextField(max_length=5000)
30 screenshot_url = models.ManyToManyField(ScreenshotURL)39 screenshot_url = models.ManyToManyField(ScreenshotURL, blank=True)
31 website = models.URLField(blank=True)40 website = models.URLField(blank=True)
41
42 def __str__(self):
43 return self.name
3244
=== removed file 'store_data/tests.py'
--- store_data/tests.py 2015-06-23 09:23:50 +0000
+++ store_data/tests.py 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1from django.test import TestCase
2
3# Create your tests here.
40
=== modified file 'store_data/urls.py'
--- store_data/urls.py 2015-06-23 09:23:50 +0000
+++ store_data/urls.py 2016-03-29 08:41:51 +0000
@@ -1,5 +1,5 @@
1from django.contrib import admin
1from django.contrib.staticfiles.urls import staticfiles_urlpatterns2from django.contrib.staticfiles.urls import staticfiles_urlpatterns
3
2urlpatterns = staticfiles_urlpatterns()4urlpatterns = staticfiles_urlpatterns()
3
4from django.contrib import admin
5admin.autodiscover()5admin.autodiscover()
66
=== removed file 'store_data/views.py'
--- store_data/views.py 2015-06-23 09:23:50 +0000
+++ store_data/views.py 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1from django.shortcuts import render
2
3# Create your views here.

Subscribers

People subscribed via source and target branches