Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working #219

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boranga/components/conservation_status/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1733,4 +1733,4 @@ class ConservationStatusAmendmentRequestDocument(Document):

def delete(self):
if self.can_delete:
return super(ConservationStatusAmendmentRequestDocument, self).delete()
return super(ConservationStatusAmendmentRequestDocument, self).delete()
13 changes: 8 additions & 5 deletions boranga/components/main/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
from django.urls import reverse
from boranga.components.main.models import (
ApplicationType,
RequiredDocument, Question, GlobalSettings
# RequiredDocument,
Question,
GlobalSettings
)
from boranga.components.main.serializers import (
ApplicationTypeSerializer,
RequiredDocumentSerializer, QuestionSerializer, GlobalSettingsSerializer, OracleSerializer, BookingSettlementReportSerializer,
# RequiredDocumentSerializer,
QuestionSerializer, GlobalSettingsSerializer, OracleSerializer, BookingSettlementReportSerializer,
)
from django.core.exceptions import ValidationError
from django.db.models import Q
Expand All @@ -37,9 +40,9 @@ class GlobalSettingsViewSet(viewsets.ReadOnlyModelViewSet):
serializer_class = GlobalSettingsSerializer


class RequiredDocumentViewSet(viewsets.ReadOnlyModelViewSet):
queryset = RequiredDocument.objects.all()
serializer_class = RequiredDocumentSerializer
# class RequiredDocumentViewSet(viewsets.ReadOnlyModelViewSet):
# queryset = RequiredDocument.objects.all()
# serializer_class = RequiredDocumentSerializer

# def get_queryset(self):
# categories=ActivityCategory.objects.filter(activity_type='marine')
Expand Down
14 changes: 7 additions & 7 deletions boranga/components/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ class Meta:
abstract = True


#@python_2_unicode_compatible
class RequiredDocument(models.Model):
question = models.TextField(blank=False)
# #@python_2_unicode_compatible
# class RequiredDocument(models.Model):
# question = models.TextField(blank=False)

class Meta:
app_label = 'boranga'
# class Meta:
# app_label = 'boranga'

def __str__(self):
return self.question
# def __str__(self):
# return self.question

#@python_2_unicode_compatible
class ApplicationType(models.Model):
Expand Down
13 changes: 8 additions & 5 deletions boranga/components/main/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
from django.db.models import Sum, Max
from boranga.components.main.models import (
CommunicationsLogEntry,
RequiredDocument, Question, GlobalSettings, ApplicationType,
# RequiredDocument,
Question,
GlobalSettings,
ApplicationType,
)
from ledger_api_client.ledger_models import EmailUserRO as EmailUser, EmailUserRO
from datetime import datetime, date
Expand Down Expand Up @@ -52,10 +55,10 @@ class Meta:



class RequiredDocumentSerializer(serializers.ModelSerializer):
class Meta:
model = RequiredDocument
fields = ('id', 'park','activity', 'question')
# class RequiredDocumentSerializer(serializers.ModelSerializer):
# class Meta:
# model = RequiredDocument
# fields = ('id', 'park','activity', 'question')


class QuestionSerializer(serializers.ModelSerializer):
Expand Down
14 changes: 7 additions & 7 deletions boranga/components/occurrence/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ class Meta:
def __str__(self):
return str(self.occurrence_report) # TODO: is the most appropriate?


# Is used in HabitatComposition for multiple selection
class LandForm(models.Model):
"""
# Admin List
Expand Down Expand Up @@ -1011,13 +1011,13 @@ class Meta:
def __str__(self):
return str(self.occurrence_report)


# used for Animal Observation(MultipleSelect)
class PrimaryDetectionMethod(models.Model):
"""
# Admin List

Used by:
- AnimalObservation
- AnimalObservation (MultipleSelect)

"""
name = models.CharField(max_length=250, blank=False, null=False, unique=True)
Expand All @@ -1029,13 +1029,13 @@ class Meta:
def __str__(self):
return str(self.name)


# used for Animal Observation(MultipleSelect)
class ReproductiveMaturity(models.Model):
"""
# Admin List

Used by:
- AnimalObservation
- AnimalObservation (MultipleSelect)

"""
name = models.CharField(max_length=250, blank=False, null=False, unique=True)
Expand Down Expand Up @@ -1087,13 +1087,13 @@ class Meta:
def __str__(self):
return str(self.name)


# sed for Animal Observation(MultipleSelect)
class SecondarySign(models.Model):
"""
# Admin List

Used by:
- AnimalObservation
- AnimalObservation (MultipleSelect)

"""
name = models.CharField(max_length=250, blank=False, null=False, unique=True)
Expand Down
6 changes: 3 additions & 3 deletions boranga/components/proposals/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SystemMaintenance,
ApplicationType,
OracleCode,
RequiredDocument,
# RequiredDocument,
Question,
GlobalSettings,
)
Expand Down Expand Up @@ -142,8 +142,8 @@ class OracleCodeInline(admin.TabularInline):
can_delete = False

# @admin.register(RequiredDocument)
class RequiredDocumentAdmin(admin.ModelAdmin):
pass
# class RequiredDocumentAdmin(admin.ModelAdmin):
# pass

# @admin.register(GlobalSettings)
class GlobalSettingsAdmin(admin.ModelAdmin):
Expand Down
2 changes: 1 addition & 1 deletion boranga/components/proposals/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

from django.urls import reverse
from django.shortcuts import render, redirect, get_object_or_404
from boranga.components.main.models import Document, ApplicationType, RequiredDocument
from boranga.components.main.models import Document, ApplicationType
from boranga.components.proposals.models import (
ProposalType,
Proposal,
Expand Down
5 changes: 3 additions & 2 deletions boranga/components/proposals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#Organisation as ledger_organisation, OrganisationAddress,
CommunicationsLogEntry, UserAction, Document,
ApplicationType,
RequiredDocument, RevisionedMixin
# RequiredDocument,
RevisionedMixin
)
from boranga.components.main.utils import get_department_user
from boranga.components.proposals.email import (
Expand Down Expand Up @@ -255,7 +256,7 @@ class ProposalRequiredDocument(Document):
_file = models.FileField(upload_to=update_proposal_required_doc_filename, max_length=512, storage=private_storage)
input_name = models.CharField(max_length=255,null=True,blank=True)
can_delete = models.BooleanField(default=True) # after initial submit prevent document from being deleted
required_doc = models.ForeignKey('RequiredDocument',related_name='proposals', on_delete=models.CASCADE)
# required_doc = models.ForeignKey('RequiredDocument',related_name='proposals', on_delete=models.CASCADE)
can_hide= models.BooleanField(default=False) # after initial submit, document cannot be deleted but can be hidden
hidden=models.BooleanField(default=False) # after initial submit prevent document from being deleted

Expand Down
6 changes: 0 additions & 6 deletions boranga/components/species_and_communities/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,9 @@
District,
SpeciesDistribution,
CommunityDistribution,
# FloweringPeriod,
# FruitingPeriod,
FloraRecruitmentType,
SeedViabilityGerminationInfo,
RootMorphology,
PollinatorInformation,
PostFireHabitatInteraction,
# BreedingPeriod,
FaunaBreeding,
SpeciesConservationAttributes,
CommunityConservationAttributes,
DocumentCategory,
Expand Down
133 changes: 0 additions & 133 deletions boranga/components/species_and_communities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,24 +899,6 @@ def __str__(self):
return str(self.id) # TODO: is the most appropriate?


# TODO Model not used anymore
class CommunityName(models.Model):
"""
# list derived from TEC

Used by:
- Taxonomy

"""
name = models.CharField(max_length=200, blank=False, unique=True)

class Meta:
app_label = 'boranga'

def __str__(self):
return str(self.name)


class Community(models.Model):
"""
A collection of 2 or more Species within a specific location.
Expand Down Expand Up @@ -1732,47 +1714,6 @@ def source(self):
return self.community.id


# list used in Conservation Attributes
# class FloweringPeriod(models.Model):
# """
# # list derived from WACensus

# Used by:
# - SpeciesConservationAttributes

# """
# period = models.CharField(max_length=200, blank=False, unique=True)

# class Meta:
# app_label = 'boranga'
# verbose_name = "Flowering Period"
# verbose_name_plural = "Flowering Periods"
# ordering = ['period']

# def __str__(self):
# return str(self.period)


# class FruitingPeriod(models.Model):
# """
# # list derived from WACensus

# Used by:
# - SpeciesConservationAttributes

# """
# period = models.CharField(max_length=200, blank=False, unique=True)

# class Meta:
# app_label = 'boranga'
# verbose_name = "Fruiting Period"
# verbose_name_plural = "Fruiting Periods"
# ordering = ['period']

# def __str__(self):
# return str(self.period)


class FloraRecruitmentType(models.Model):
"""
# list derived from WACensus
Expand All @@ -1792,24 +1733,6 @@ class Meta:
def __str__(self):
return str(self.recruitment_type)

# TODO Not used
class SeedViabilityGerminationInfo(models.Model):
"""
# list derived from WACensus

Used by:
- SpeciesConservationAttributes

"""
name = models.CharField(max_length=200, blank=False, unique=True)

class Meta:
app_label = 'boranga'
ordering = ['name']

def __str__(self):
return str(self.name)


class RootMorphology(models.Model):
"""
Expand All @@ -1830,24 +1753,6 @@ class Meta:
def __str__(self):
return str(self.name)

# TODO Not used
class PollinatorInformation(models.Model):
"""
# list derived from WACensus

Used by:
- SpeciesConservationAttributes

"""
name = models.CharField(max_length=200, blank=False, unique=True)

class Meta:
app_label = 'boranga'
ordering = ['name']

def __str__(self):
return str(self.name)


class PostFireHabitatInteraction(models.Model):
"""
Expand All @@ -1869,44 +1774,6 @@ def __str__(self):
return str(self.name)


# class BreedingPeriod(models.Model):
# """
# # list derived from WACensus

# Used by:
# - SpeciesConservationAttributes

# """
# period = models.CharField(max_length=200, blank=False, unique=True)

# class Meta:
# app_label = 'boranga'
# verbose_name = "Breeding Period"
# verbose_name_plural = "Breeding Periods"
# ordering = ['period']

# def __str__(self):
# return str(self.period)

# TODO Not USed
class FaunaBreeding(models.Model):
"""
# list derived from WACensus

Used by:
- SpeciesConservationAttributes

"""
breeding_type = models.CharField(max_length=200, blank=False, unique=True)

class Meta:
app_label = 'boranga'
ordering = ['breeding_type']

def __str__(self):
return str(self.breeding_type)


class SpeciesConservationAttributes(models.Model):
"""
Species conservation attributes data.
Expand Down
Loading
Loading