1

I am looking for a way to generate a Django form based on a Python data structure such as an Array or a List of an un-specfied size or contents.

For example if the array contained ['Name', 'Question 1', 'Question 2'] a Django form with fields 'Name' 'Question 1' 'Question 2' would be generated. If array contained ['Question 20'] a Django form with field 'Question 20' would be generated.

I have looked through Django form factory, but I have not found a generator that works off an Array rather than a Django model.

I am a beginner with Django and Python so am not sure of any way to approach this problem.

1
  • Have you tried anything so far? Where is your code? Commented Apr 18, 2016 at 4:20

1 Answer 1

1

List cannot provide enough details about forms fields. Store forms as json: https://github.com/WiserTogether/django-remote-forms

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.