Closed mema0341 closed 5 years ago
@mema0341:
Probably you have forgotten to add db_store handler to your form.
Isn't that what the custom_action does?
from django import forms from fobi.base import BasePluginForm
class SampleTextareaForm(forms.Form, BasePluginForm): plugin_data_fields = [ ("name", ""), ("label", ""), ("initial", ""), ("required", False) ]
name = forms.CharField(label="Name", required=True)
label = forms.CharField(label="Label", required=True)
initial = forms.CharField(label="Initial", required=False)
required = forms.BooleanField(label="Required", required=False)
def custom_actions(self): return ( ( reverse('fobi.contrib.plugins.form_handlers.db_store.view_saved_form_dataentries'), ("View entries"), 'glyphicon glyphicon-list' ), )
@mema0341
See the online demo. If it works for you, double check your settings and see the example project.
@mema0341:
As far as I understand, you want to have your form submissions saved. DB store form handler plugin is responsible for that. In order to have it working, follow the documentation precisely.
So, you need to (1) have it in the URLs, (2) add it to your INSTALLED_APPS and (3) assign it to every form you want to use it with.
If you still can't make it working, contact me by email (see AUTHOR
section of the main README.rst). I could consult you more (premium paid support).
Thanks Artur, I guess I was just getting confused because the forms I created were from clicking the "Create Form" button, not forms that I have specifically created myself and therefore I haven't assigned db_store to those forms. Can you point me to where this is discussed in the documentation?
@mema0341:
Sorry, I can't do more than I already did.
That's ok! Thanks for all of your help :) also figured it out using the very helpful screenshots in the docs. Sorry for not understanding immediately, I am very new to Django.
I've followed the documentation in https://django-fobi.readthedocs.io/en/0.13.10/ and the Quick Start to try and get the saved data entries to appear but with no success. I've add the db_store to my installed apps and this code at the bottom of forms.py:
def custom_actions(self): """Adding a link to view the saved form entries.
With no success.
Any tips?