Versioning module now does magic

Automatic creation of views/urls for anything registered with reversion, with a small amount of hackage to preserve legacy stuff. (and the DAMNED asset IDs!) I would never get distracted...
This commit is contained in:
2020-08-29 16:23:10 +01:00
parent 8ea96674db
commit d708207ab9
23 changed files with 188 additions and 197 deletions

View File

@@ -20,6 +20,19 @@ from RIGS import models, forms
from assets import models as asset_models
from functools import reduce
from django.views.decorators.cache import never_cache
from django.utils.decorators import method_decorator
# Displays the current rig count along with a few other bits and pieces
@method_decorator(never_cache, name='dispatch') # Disable browser based caching
class Index(generic.TemplateView):
template_name = 'index.html'
def get_context_data(self, **kwargs):
context = super(Index, self).get_context_data(**kwargs)
context['rig_count'] = models.Event.objects.rig_count()
return context
class SecureAPIRequest(generic.View):
models = {