Skip to content

Commit dbb904e

Browse files
author
Garito
committed
Revert "Added RadioField to model_form"
This reverts commit 372935d.
1 parent 372935d commit dbb904e

File tree

4 files changed

+2
-23
lines changed

4 files changed

+2
-23
lines changed

AUTHORS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ that much better:
2727
* Peter D. Gray
2828
* Massimo Santini
2929
* Len Buckens - https://github.com/buckensl
30-
* Garito - https://github.com/garito

flask_mongoengine/sessions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def get_expiration_time(self, app, session):
5353
if session.permanent:
5454
return app.permanent_session_lifetime
5555
if 'SESSION_TTL' in app.config:
56-
return datetime.timedelta(**app.config['SESSION_TTL'])
56+
return datetime.timedelta(**app.config['SESSION_TTL'])
5757
return datetime.timedelta(days=1)
5858

5959
def open_session(self, app, request):

flask_mongoengine/wtf/orm.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ def convert(self, model, field, field_args):
6868
kwargs["coerce"] = self.coerce(ftype)
6969
if kwargs.pop('multiple', False):
7070
return f.SelectMultipleField(**kwargs)
71-
if kwargs.pop('radio', False):
72-
return f.RadioField(**kwargs)
7371
return f.SelectField(**kwargs)
7472

7573
ftype = type(field).__name__
@@ -99,7 +97,6 @@ def conv_String(self, model, field, kwargs):
9997
if field.regex:
10098
kwargs['validators'].append(validators.Regexp(regex=field.regex))
10199
self._string_common(model, field, kwargs)
102-
103100
if 'password' in kwargs:
104101
if kwargs.pop('password'):
105102
return f.PasswordField(**kwargs)

tests/test_forms.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -290,24 +290,7 @@ class DogOwner(db.Document):
290290
self.assertEqual(len(choices), 2)
291291
self.assertFalse(choices[0].checked)
292292
self.assertFalse(choices[1].checked)
293-
294-
def test_modelradiofield(self):
295-
with self.app.test_request_context('/'):
296-
db = self.db
297-
298-
choices = (('male', 'Male'), ('female', 'Female'), ('other', 'Other'))
299-
300-
class Poll(db.Document):
301-
answer = db.StringField(choices=choices)
302-
303-
PollForm = model_form(Poll, field_args={'answer': {'radio': True}})
304-
305-
form = PollForm(answer=None)
306-
self.assertTrue(form.validate())
307-
308-
self.assertEqual(form.answer.type, 'RadioField')
309-
self.assertEqual(form.answer.choices, choices)
310-
293+
311294
def test_passwordfield(self):
312295
with self.app.test_request_context('/'):
313296
db = self.db

0 commit comments

Comments
 (0)