Skip to content

Commit

Permalink
Changing name of add_form_tag to form_tag because that follows our pa…
Browse files Browse the repository at this point in the history
…ttern for attribute names better. Also, 'add' is used in a couple of FormHelper method names so again this increases clarity
  • Loading branch information
pydanny committed Apr 12, 2010
1 parent 0722cbc commit 0791343
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For 0.8.0
* Improved internal documentation
* form methods generated by FormHelper are in lowercase (http:https://github.com/pydanny/django-uni-form/issues#issue/20)
* uni_form.helpers.formHelper or None object must be passed into uni_form tag or a TypeError is thrown.
* Thanks to Nagy Viktor added add_form_tag attribute to FormHelper. Now you can use the uni_form tag without the leading and training form tags.
* Thanks to Nagy Viktor added form_tag attribute to FormHelper. Now you can use the uni_form tag without the leading and training form tags.

For 0.7.0

Expand Down
2 changes: 1 addition & 1 deletion test_project/test_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def lacking_form_tag(request):
helper = FormHelper()

# remove the form tag
helper.add_form_tag = False
helper.form_tag = False

# create the response dictionary
response_dictionary = {'form':form, 'helper': helper}
Expand Down
6 changes: 3 additions & 3 deletions uni_form/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class FormHelper(object):
Defaults to uniForm.
Always starts with uniForm even do specify classes.
add_form_tag: Defaults to True. If set to False it renders the form without the form tags.
form_tag: Defaults to True. If set to False it renders the form without the form tags.
Demonstration:
Expand Down Expand Up @@ -243,7 +243,7 @@ def __init__(self):
self.inputs = []
self.toggle = Toggle()
self.layout = None
self.add_form_tag = True
self.form_tag = True

def get_form_method(self):
return self._form_method
Expand Down Expand Up @@ -282,7 +282,7 @@ def render_layout(self, form):
def get_attr(self):
items = {}
items['form_method'] = self.form_method.strip()
items['add_form_tag'] = self.add_form_tag
items['form_tag'] = self.form_tag

if self.form_action:
items['form_action'] = self.form_action.strip()
Expand Down
2 changes: 1 addition & 1 deletion uni_form/templatetags/uni_form_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_render(self, context):
inputs = []
toggle_fields = set(())
if attrs:
form_tag = attrs.get("add_form_tag", True)
form_tag = attrs.get("form_tag", True)
form_method = attrs.get("form_method", 'POST')
form_action = attrs.get("form_action", '')
form_class = attrs.get("class", '')
Expand Down

0 comments on commit 0791343

Please sign in to comment.