Archived
Adds groups fixture and adds it to recreate script
This commit is contained in:
1 parent
e6571ec6fd
commit
ff13f00c2b
3 files changed
+43
No files matched your search
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"pk": 1,
|
||||
"model": "dusken.group",
|
||||
"fields": {
|
||||
"updated": "2013-09-18T18:31:27.377Z",
|
||||
"created": "2013-09-18T18:14:49.159Z",
|
||||
"permissions": [
|
||||
19, 20, 21, 4, 5, 6,
|
||||
1, 2, 3, 7, 8, 9, 10,
|
||||
11, 12, 25, 26, 27, 22,
|
||||
23, 24, 43, 44, 45, 37,
|
||||
38, 39, 40, 41, 42, 58,
|
||||
59, 60, 28, 29, 30, 34,
|
||||
35, 36, 55, 56, 57, 52,
|
||||
53, 54, 49, 50, 51, 46,
|
||||
47, 48, 31, 32, 33, 13,
|
||||
14, 15, 16, 17, 18, 61,
|
||||
62, 63, 64, 65, 66, 67,
|
||||
68, 69
|
||||
],
|
||||
"posix_name": "EDB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 2,
|
||||
"model": "dusken.group",
|
||||
"fields": {
|
||||
"updated": "2013-09-18T18:32:02.861Z",
|
||||
"created": "2013-09-18T18:32:02.861Z",
|
||||
"permissions": [35],
|
||||
"posix_name": "KAK"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -100,6 +100,7 @@ class GoogleAuth(BaseModel):
|
||||
token_expires = models.DateTimeField(null=True, blank=True)
|
||||
member = models.OneToOneField('dusken.Member', null=True, blank=True)
|
||||
|
||||
|
||||
class Address(BaseModel):
|
||||
class Meta:
|
||||
verbose_name_plural = "Addresses"
|
||||
@@ -116,6 +117,7 @@ class Address(BaseModel):
|
||||
city = models.CharField(max_length=100)
|
||||
country = models.ForeignKey('dusken.Country', null=True, blank=True)
|
||||
|
||||
|
||||
class Country(BaseModel):
|
||||
class Meta:
|
||||
verbose_name_plural = "Countries"
|
||||
@@ -126,6 +128,7 @@ class Country(BaseModel):
|
||||
name = models.CharField(max_length=100, unique=True)
|
||||
code = models.CharField(max_length=3, unique=True) #ISO 3166-1 alpha 2
|
||||
|
||||
|
||||
class PlaceOfStudy(BaseModel):
|
||||
def __unicode__(self):
|
||||
return u"{institution}, {year}".format(
|
||||
@@ -135,6 +138,7 @@ class PlaceOfStudy(BaseModel):
|
||||
from_date = models.DateField()
|
||||
institution = models.ForeignKey('dusken.Institution')
|
||||
|
||||
|
||||
class Institution(BaseModel):
|
||||
def __unicode__(self):
|
||||
return u'%s - %s' % (self.short_name, self.name)
|
||||
@@ -142,9 +146,11 @@ class Institution(BaseModel):
|
||||
name = models.CharField(max_length=255)
|
||||
short_name = models.CharField(max_length=16)
|
||||
|
||||
|
||||
class ExtendedMemberDetail(BaseModel):
|
||||
pass
|
||||
|
||||
|
||||
class Group(django.contrib.auth.models.Group):
|
||||
def __unicode__(self):
|
||||
return u"{} ({})".format(self.name, self.posix_name)
|
||||
|
||||
@@ -20,6 +20,8 @@ echo ' - Address'
|
||||
python manage.py loaddata dusken/fixtures/address.json > /dev/null
|
||||
echo ' - Institution'
|
||||
python manage.py loaddata dusken/fixtures/institution.json > /dev/null
|
||||
echo ' - Group'
|
||||
python manage.py loaddata dusken/fixtures/group.json
|
||||
|
||||
echo ''
|
||||
echo 'Done.'
|
||||
|
||||
Reference in new issue
Block a user