зеркало из https://github.com/mozilla/FlightDeck.git
jetpack application added, dev environment fixed
This commit is contained in:
Родитель
63342a905d
Коммит
55568d07b5
|
@ -0,0 +1,13 @@
|
|||
from django.contrib import admin
|
||||
|
||||
from models import Jetpack, Version
|
||||
|
||||
class JetpackAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
admin.site.register(Jetpack, JetpackAdmin)
|
||||
|
||||
|
||||
class VersionAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
admin.site.register(Version, VersionAdmin)
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class Jetpack(models.Model):
|
||||
PERMISSIONS_CHOICEiS = (
|
||||
(0, 'denied'),
|
||||
(1, 'view'),
|
||||
(2, 'edit'),
|
||||
)
|
||||
|
||||
name = models.CharField(max_length=255)
|
||||
decription = models.TextField(blank=True, null=True)
|
||||
author = models.ForeignKey(User, related_name="authored_jetpacks")
|
||||
managers = models.ManyToManyField(User, related_name="managed_jetpacks")
|
||||
developers = models.ManyToManyField(User, related_name="developed_jetpacks")
|
||||
public_permission = models.IntegerField(choices=PERMISSIONS_CHOICEiS)
|
||||
group_permission = models.IntegerField(choices=PERMISSIONS_CHOICEiS)
|
||||
|
||||
|
||||
|
||||
STATUS_CHOICES = (
|
||||
('a', 'alpha'),
|
||||
('b', 'beta'),
|
||||
('p', 'production')
|
||||
)
|
||||
|
||||
class Version(models.Model):
|
||||
jetpack = models.ForeignKey(Jetpack, related_name="versions")
|
||||
name = models.CharField(max_length=255)
|
||||
decription = models.TextField(blank=True, null=True)
|
||||
code = models.TextField(blank=True, null=True)
|
||||
status = models.CharField(max_length=1, choices=STATUS_CHOICES)
|
||||
published = models.BooleanField(default=False, blank=True)
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
"""
|
||||
This file demonstrates two different styles of tests (one doctest and one
|
||||
unittest). These will both pass when you run "manage.py test".
|
||||
|
||||
Replace these with more appropriate tests for your application.
|
||||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
class SimpleTest(TestCase):
|
||||
def test_basic_addition(self):
|
||||
"""
|
||||
Tests that 1 + 1 always equals 2.
|
||||
"""
|
||||
self.failUnlessEqual(1 + 1, 2)
|
||||
|
||||
__test__ = {"doctest": """
|
||||
Another way to test that 1 + 1 is equal to 2.
|
||||
|
||||
>>> 1 + 1 == 2
|
||||
True
|
||||
"""}
|
||||
|
|
@ -0,0 +1 @@
|
|||
# Create your views here.
|
|
@ -96,7 +96,8 @@ INSTALLED_APPS.extend([
|
|||
# FlightDeck apps
|
||||
'base', # basic flightdeck things (utils, urls)
|
||||
'person', # user related stuff (profile etc.)
|
||||
'amo' # addons.mozilla.org integration (authentication state updates)
|
||||
'amo', # addons.mozilla.org integration (authentication state updates)
|
||||
'jetpack', # Jetpack functionality
|
||||
])
|
||||
|
||||
AUTH_PROFILE_MODULE = 'person.Profile'
|
||||
|
|
|
@ -6,4 +6,4 @@ source scripts/config_local.sh
|
|||
source $V_ENV/bin/activate
|
||||
|
||||
# set path to the project direcotry
|
||||
PYTHONPATH=$PROJECT_DIR:$PYTHONPATH
|
||||
PYTHONPATH=$PROJECT_DIR/$PROJECT_NAME:$PROJECT_DIR:$PYTHONPATH
|
||||
|
|
Загрузка…
Ссылка в новой задаче