Parent: [320778] (diff)

Child: [77e4cc] (diff)

Download this file

views.py    18 lines (14 with data), 641 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from django.shortcuts import render
from django.http import HttpResponse
from entity.models import Entity
# Create your views here.
def search_html(request, entity_id):
"""
Moved it in the OSProject app
"""
entity = Entity.objects.get(pk=entity_id)
exec("from " + entity.actual_entity_app + ".models import " + entity.actual_entity_class + ", " + entity.actual_entity_search_class)
actual_entity_class = locals()[entity.actual_entity_class]
ae = actual_entity_class()
actual_entity_search_class = locals()[entity.actual_entity_search_class]
return HttpResponse(actual_entity_search_class.html_ui())