Skip to content

Commit

Permalink
fix: avoid creating new migrations on changing DynamicFields list
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Nov 7, 2023
1 parent fc204a4 commit 99631d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion django_form_builder/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import sys

from django.db import models
from django.utils.translation import gettext_lazy as _
Expand All @@ -8,12 +9,17 @@
from . utils import get_as_dict


_dynamic_fields = get_fields_types()
if 'makemigrations' in sys.argv or 'migrate' in sys.argv: # pragma: no cover
_dynamic_fields = [('', '-')]


class DynamicFieldMap(models.Model):
"""
"""
name = models.CharField(max_length=150,)
field_type = models.CharField(max_length=100,
choices = get_fields_types())
choices = _dynamic_fields)
valore = models.TextField(max_length=20000,
blank=True,
default='',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name='django-form-builder',
version='1.0.0',
version='1.0.1',
packages=find_packages(),
package_data={'': ['*.wav']},
data_files=[
Expand Down

0 comments on commit 99631d6

Please sign in to comment.