I am trying to include form entries from django-forms-builder
as a (generic, if necessary) inline in the django admin.
However, when I do this, my form fields are not showing up, only the date and time are, the only fields defined in the abstract base class.
UPDATE - The above is quite understandable given that the fields are dynamically injected. django-forms-builder
sublcasses the abstract base class, creating FormEntry
, Form
, FormField
models.
Essentially, I need to be able to retrieve the actual FormEntry
of a given type of Form
.
UPDATE 2 - Possibly relevant and helpful links:
Override ModelAdmin.form
?
or... create a custom AJAX-hackish solution
models.py
from forms_builder.forms import models as fmodels
class FormEntry(fmodels.<s>Abstract</s>FormEntry):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
pass
admin.py
class FormEntryInline(generic.GenericStackedInline):
model = FormEntry
I believe that, since the source for django-forms-builder
relies on abstract classes, I may not be subclassing properly. Do I need to define a queryset? Any help would be appreciated.