mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-21 07:22:14 +00:00
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user