@ -3,6 +3,7 @@ from django.db import models
|
|||||||
from access.fields import *
|
from access.fields import *
|
||||||
from access.models import TenancyObject
|
from access.models import TenancyObject
|
||||||
|
|
||||||
|
from core.mixin.history_save import SaveHistory
|
||||||
|
|
||||||
|
|
||||||
class SoftwareCommonFields(TenancyObject, models.Model):
|
class SoftwareCommonFields(TenancyObject, models.Model):
|
||||||
@ -30,7 +31,7 @@ class SoftwareCommonFields(TenancyObject, models.Model):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SoftwareCategory(SoftwareCommonFields):
|
class SoftwareCategory(SoftwareCommonFields, SaveHistory):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ class SoftwareCategory(SoftwareCommonFields):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Software(SoftwareCommonFields):
|
class Software(SoftwareCommonFields, SaveHistory):
|
||||||
|
|
||||||
category = models.ForeignKey(
|
category = models.ForeignKey(
|
||||||
SoftwareCategory,
|
SoftwareCategory,
|
||||||
@ -55,7 +56,7 @@ class Software(SoftwareCommonFields):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SoftwareVersion(SoftwareCommonFields):
|
class SoftwareVersion(SoftwareCommonFields, SaveHistory):
|
||||||
|
|
||||||
software = models.ForeignKey(
|
software = models.ForeignKey(
|
||||||
Software,
|
Software,
|
||||||
|
|||||||
@ -58,6 +58,9 @@ class View(OrganizationPermission, generic.UpdateView):
|
|||||||
context['notes_form'] = AddNoteForm(prefix='note')
|
context['notes_form'] = AddNoteForm(prefix='note')
|
||||||
context['notes'] = Notes.objects.filter(software=self.kwargs['pk'])
|
context['notes'] = Notes.objects.filter(software=self.kwargs['pk'])
|
||||||
|
|
||||||
|
context['model_pk'] = self.kwargs['pk']
|
||||||
|
context['model_name'] = self.model._meta.verbose_name.replace(' ', '')
|
||||||
|
|
||||||
context['content_title'] = self.object.name
|
context['content_title'] = self.object.name
|
||||||
|
|
||||||
if self.request.user.is_superuser:
|
if self.request.user.is_superuser:
|
||||||
|
|||||||
Reference in New Issue
Block a user