aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-02-27 08:27:42 +0000
committerMatthew Lemon <matt@matthewlemon.com>2020-02-27 08:27:42 +0000
commit84f6f9e552a14345ce5ea2611ee39636be9ff60d (patch)
tree96dcc6e06ed36b16862ecd06d772732339173eee
parent77572ddf5122947d98a26082d774d6d2c0a74d16 (diff)
renamed CAFFileStore to FileStore
-rw-r--r--ctrack/caf/admin.py4
-rw-r--r--ctrack/caf/migrations/0013_auto_20200227_0827.py18
-rw-r--r--ctrack/caf/models.py4
-rw-r--r--ctrack/caf/tests/factories.py9
-rw-r--r--ctrack/organisations/management/commands/populate_db.py4
5 files changed, 28 insertions, 11 deletions
diff --git a/ctrack/caf/admin.py b/ctrack/caf/admin.py
index 6a87233..661a793 100644
--- a/ctrack/caf/admin.py
+++ b/ctrack/caf/admin.py
@@ -1,6 +1,6 @@
from django.contrib import admin
-from .models import CAF, CAFFileStore, DocumentFile, Grading, EssentialService
+from .models import CAF, FileStore, DocumentFile, Grading, EssentialService
class EssentialServiceListAdmin(admin.ModelAdmin):
@@ -23,7 +23,7 @@ class CAFAdmin(admin.ModelAdmin):
admin.site.register(CAF, CAFAdmin)
-admin.site.register(CAFFileStore)
+admin.site.register(FileStore)
admin.site.register(DocumentFile)
admin.site.register(Grading)
admin.site.register(EssentialService, EssentialServiceListAdmin)
diff --git a/ctrack/caf/migrations/0013_auto_20200227_0827.py b/ctrack/caf/migrations/0013_auto_20200227_0827.py
new file mode 100644
index 0000000..6aab6b4
--- /dev/null
+++ b/ctrack/caf/migrations/0013_auto_20200227_0827.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.9 on 2020-02-27 08:27
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organisations', '0004_auto_20200220_1634'),
+ ('caf', '0012_auto_20200226_2202'),
+ ]
+
+ operations = [
+ migrations.RenameModel(
+ old_name='CAFFileStore',
+ new_name='FileStore',
+ ),
+ ]
diff --git a/ctrack/caf/models.py b/ctrack/caf/models.py
index 2a9310c..c17f064 100644
--- a/ctrack/caf/models.py
+++ b/ctrack/caf/models.py
@@ -13,7 +13,7 @@ class Grading(models.Model):
return self.descriptor
-class CAFFileStore(models.Model):
+class FileStore(models.Model):
descriptor = models.CharField(max_length=100)
virtual_location = models.CharField(
max_length=100, help_text="USB, Rosa, email, etc"
@@ -33,7 +33,7 @@ class DocumentFile(models.Model):
FILETYPE_CHOICES = [(1, "Excel"), (2, "Word"), (3, "PDF"), (4, "Hard Copy")]
name = models.CharField(max_length=255)
type = models.IntegerField(choices=FILETYPE_CHOICES, default=1)
- file_store_location = models.ForeignKey(CAFFileStore, on_delete=models.CASCADE)
+ file_store_location = models.ForeignKey(FileStore, on_delete=models.CASCADE)
class EssentialService(models.Model):
diff --git a/ctrack/caf/tests/factories.py b/ctrack/caf/tests/factories.py
index ce337f2..53953fe 100644
--- a/ctrack/caf/tests/factories.py
+++ b/ctrack/caf/tests/factories.py
@@ -3,7 +3,7 @@ import random
import factory
from factory import Faker
-from ctrack.caf.models import EssentialService, Grading, DocumentFile, FileStore, CAFFileStore
+from ctrack.caf.models import EssentialService, Grading, DocumentFile, FileStore
from ctrack.organisations.tests.factories import OrganisationFactory
@@ -23,21 +23,20 @@ class GradingFactory(factory.DjangoModelFactory):
model = Grading
-# TODO: test these two factories
-class CAFFileStoreFactory(factory.DjangoModelFactory):
+class FileStoreFactory(factory.DjangoModelFactory):
descriptor = "File Store X"
virtual_location = Faker("street_name")
physical_location = random.choice(["Cupboard A", "Tin Box", "The Vault"])
physical_location_organisation = factory.SubFactory(OrganisationFactory)
class Meta:
- model = CAFFileStore
+ model = FileStore
class DocumentFileFactory(factory.DjangoModelFactory):
name = Faker("file_name", extension="xlsx")
type = random.choice([1, 2, 3, 4])
- file_store_location = factory.SubFactory(CAFFileStoreFactory)
+ file_store_location = factory.SubFactory(FileStoreFactory)
class Meta:
model = DocumentFile
diff --git a/ctrack/organisations/management/commands/populate_db.py b/ctrack/organisations/management/commands/populate_db.py
index bcecc1a..ea81dfe 100644
--- a/ctrack/organisations/management/commands/populate_db.py
+++ b/ctrack/organisations/management/commands/populate_db.py
@@ -3,7 +3,7 @@ from random import randint, choice
from django.core.management import BaseCommand
from django.core.management import CommandParser
-from ctrack.caf.tests.factories import GradingFactory, CAFFileStoreFactory
+from ctrack.caf.tests.factories import GradingFactory, FileStoreFactory
from ctrack.organisations.models import AddressType
from ctrack.organisations.models import Mode
from ctrack.organisations.models import Submode
@@ -114,4 +114,4 @@ class Command(BaseCommand):
GradingFactory.create(descriptor=g, type="CONFIDENCE")
# File store
- fs = CAFFileStoreFactory.create(physical_location_organistion=orgs[1])
+ fs = FileStoreFactory.create(physical_location_organistion=orgs[1])