Skip to content

Commit

Permalink
Merge pull request #328 from MasoniteFramework/fix-multi-form-values
Browse files Browse the repository at this point in the history
added hotfix for multi select values
  • Loading branch information
josephmancuso committed Sep 14, 2018
2 parents 58a7381 + 2d666f1 commit f2056f8
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 97 deletions.
1 change: 1 addition & 0 deletions masonite/helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .static import static
from .password import password
from .validator import validate
from .misc import dot
16 changes: 16 additions & 0 deletions masonite/helpers/misc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def dot(data, compile_to=None):
notation_list = data.split('.')

compiling = ""
compiling += notation_list[0]
beginning_string = compile_to.split('{1}')[0]
compiling = beginning_string + compiling
dot_split = compile_to.replace(beginning_string + '{1}', '').split('{.}')
if any(len(x) > 1 for x in dot_split):
raise ValueError("Cannot have multiple values between {1} and {.}")

for notation in notation_list[1:]:
compiling += dot_split[0]
compiling += notation
compiling += dot_split[1]
return compiling
2 changes: 1 addition & 1 deletion masonite/info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Module for specifying the Masonite version in a central location.
"""

VERSION = '2.0.21'
VERSION = '2.0.22'
Loading

0 comments on commit f2056f8

Please sign in to comment.