Skip to main content

Streamline form development in Django effortlessly with this quick and code-free package. Create dynamic forms without writing code, making form development a breeze.

Project description

Zippy Form is a Django package that simplifies the creation of dynamic forms without requiring any coding.

Setup

To integrate the Zippy Form package into your Django project, follow these steps:

1. Add Package Name

  • Open your Django project's *settings.py * file.
  • Add the package name zippy_form to your project's INSTALLED_APPS.

2. Create Migration Files

  • Open your terminal or command prompt.
  • Run the following command to create migration files for the package:
python manage.py makemigrations zippy_form

3. Migrate

  • Continue in your terminal.
  • Run the following command to apply the migrations:
python manage.py migrate

4. Update URL Configuration

  • In your Django project's urls.py file, add the following URL path to include the Zippy Form package's URLs:
path('form/', include('zippy_form.urls'))

By following these setup instructions, you'll successfully integrate the Zippy Form package into your Django project, allowing you to create dynamic forms with ease.

API Documentation

Click Here to view API Documentation.


Notes To Developer

Subscribing to Zippy Form Events Using Callback Function

When specific functionalities occur on the Zippy Form, events will be triggered and you can subscribe to these events to receive data in your Django application.

Below is a list of events that you can subscribe to:

  • New Account Created: This event is triggered when a new account is successfully created. To subscribe to these event and receive data in your Django app, follow the below steps
  1. Open your project's settings file (usually named settings.py).
  2. Import the function that you want to use for subscribing the event. For example: from yourapp.event_subscriptions import zippyform_after_account_create Replace "yourapp.event_subscriptions" with the actual path to your event_subscription function.
  3. Add the below snippet to the settings file, ZF_EVENT_AFTER_ACCOUNT_CREATE = zippyform_after_account_create Replace "zippyform_after_account_created" with the name of the function you imported.
  • New Form Created: This event is triggered when a new form is successfully created. To subscribe to these event and receive data in your Django app, follow the below steps
  1. Open your project's settings file (usually named settings.py).
  2. Import the function that you want to use for subscribing the event. For example: from yourapp.event_subscriptions import zippyform_after_form_create Replace "yourapp.event_subscriptions" with the actual path to your event_subscription function.
  3. Add the below snippet to the settings file, ZF_EVENT_AFTER_FORM_CREATE = zippyform_after_form_create
  • After Form Submit: This event is triggered when a form submitted(save or update). To subscribe to these event and receive data in your Django app, follow the below steps
  1. Open your project's settings file (usually named settings.py).
  2. Import the function that you want to use for subscribing the event. For example: from yourapp.event_subscriptions import zippyform_after_form_submit Replace "yourapp.event_subscriptions" with the actual path to your event_subscription function.
  3. Add the below snippet to the settings file, ZF_EVENT_AFTER_FORM_SUBMIT = zippyform_after_form_submit

Subscribing to Zippy Form Events Using Webhooks(Upcoming Release)

When specific functionalities occur on the Zippy Form, webhooks will be triggered.

Overwrite Zippy Form Defaults

  • List Per Page Size: To overwrite the default per page size of list (which is set to 6), you can configure it in the project settings file by adding the following line: ZF_LIST_PER_PAGE = 10 Replace "10" with your desired page size value. This allows you to customize the default per page size for the Zippy Form list.

FAQ

Q: Does Zippy Form support multi-step forms? A: Yes, Zippy Form does support multi-step forms, allowing you to create and manage forms with multiple steps to collect information in a structured and user-friendly manner.

Q: Can a form be created without an account? A: No, an account needs to be created before a form can be created because each form needs to be mapped to an account.

Q: How many accounts can be created? A: There is no limit to creating accounts. If you are using the package in a standalone application, you can create a single account and map all the forms to it. If you are using the package in a multi-tenant application, you can create an account for each tenant and map the forms under that respective account.

Q: How can I synchronize my application's user account (tenant) with Zippy Form? A: When creating an account in Zippy Form, include the unique ID associated with your application's user account(tenant) in the meta_detail parameter. This unique ID serves as a linkage between your application and Zippy Form. After you've passed the unique ID, you can retrieve it when Zippy Form events occur. Whether you're using event callback functions or webhooks, the meta_detail data will be included in the event payload.

Q: Can I include additional details when creating a form in Zippy Form? A: Yes, you can pass additional details when creating a form in Zippy Form using the meta_detail parameter. This allows you to provide extra information or context related to the form. Subsequently, when Zippy Form events occur, whether you're utilizing event callback functions or webhooks, the meta_detail data you passed will be included in the event payload, enabling you to access and use it as needed.

Q: What does receiving a "permission_error" with a 403 code mean when interacting with an API? A: If you encounter a "permission_error" with a 403 status code, it typically indicates that there is an issue with authentication. This error commonly occurs when you have either missed passing the ZF-SECRET-KEY token in the header of your API request or the ZF-SECRET-KEY token provided is invalid. To resolve this, ensure that you include the correct and valid ZF-SECRET-KEY token in your API request's header for proper authentication.

Q: Where can I obtain the "ZF-SECRET-KEY"? A: You can use your Zippy Form account ID as the ZF-SECRET-KEY. This ID uniquely identifies your Zippy Form account. Obtain your Zippy Form account ID by making an API request to the Form Builder / List All Accounts endpoint. This API call will provide you with the necessary account ID to use as the ZF-SECRET-KEY in your integration.

Q: Why am I receiving an "Invalid Form ID" error message when attempting to submit a form? A: You will encounter the "Invalid Form ID" error message when submitting a form if the following conditions are not met:

  • Form Status: The form can only be submitted if its status is active. If the form is in any other state such as deleted, inactive, or draft you will receive this error message.
  • Form ID Validity: Ensure that the form ID you have provided is accurate and corresponds to an existing, active form. An incorrect or nonexistent form ID will trigger the "Invalid Form ID" error.

Q: Why are the fields I created not displaying on the form? A: Only active fields will be displayed on the form for submission. To resolve this, you can use the Form Builder / Update Form API to update the field status from draft to active ensuring that they are visible and can be submitted on the form.

Q: Can I handle my own business logic when an account is created, a form is created, or a form is submitted in Zippy Form? A: Yes, you have the flexibility to handle your own business logic when working with Zippy Form. The approach depends on whether you've installed the Zippy Form package in a standalone application or a multi-tenant application:

  • Standalone Application: If you've integrated Zippy Form into a standalone application, you can subscribe to Zippy Form events using callback functions. This feature enables you to access event data within any function you add to your application.
  • Multi-Tenant Application: For multi-tenant applications, you can subscribe to Zippy Form events using webhooks. Webhooks provide a way to receive real-time notifications about Zippy Form events, and you can handle these events in your application according to your business needs.

For detailed instructions on how to implement these approaches, please refer to the "Notes To Developer" section in the Zippy Form documentation, which provides comprehensive information on how to use callback functions and webhooks for event handling.

Q: Does the "After Form Submit" event trigger after each form step or only at the final step?

A: The "After Form Submit" event typically triggers after the last form step has been completed and the entire form has been submitted. This event occurs once the user has finished providing input and confirmed their submission. It does not trigger after each form step but rather at the conclusion of the entire form submission process.

Q: Does Zippy Form support unique validation? A: Yes, Zippy Form supports unique validation. Unique validation checks submitted entries in forms with draft and active statuses to ensure that values are unique, preventing duplicate entries.

Q: Why is my media not saving to the media folder in Zippy Form? A: Zippy Form does not control the location where media is saved; instead, it relies on your Django application's configuration. To ensure your media is saved to the correct folder, follow these steps: 1. Configure Django Settings: Open your Django project's settings file and add the following snippets:

import os

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

2. Update URL Configuration: In your Django project's urls.py file, include the ZippyForm package's URL patterns, and make sure to handle static media files by adding the following:

from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    ...  ,
    path('form/', include('zippy_form.urls')),  # Include Zippy Form package's URL patterns here
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

By following these steps and configuring your Django project correctly, media files associated with Zippy Form should be saved to the specified media folder.


Releases

Version Features
1.0.0 Form Builder, Dynamic Form, Subscribing To Events Using Callback Function

Upcoming Releases

Version Features
1.0.1 Save Submitted Form Entries To GSheet
1.0.2 Webhook Support
1.0.3 Payment Form

Project details


Release history Release notifications | RSS feed

This version

1.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

zippyform-1.0.0-py3-none-any.whl (23.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page