Skip to content

Commit

Permalink
Accepts strings as values for Lookups
Browse files Browse the repository at this point in the history
Easier for browser-based apps
  • Loading branch information
oliverroick committed Jun 10, 2014
1 parent c4e4580 commit 5bc1055
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions observationtypes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ def validate_input(self, value):
self.validate_required(value)

valid = False
try:
value = int(value)
except ValueError:
pass

for lookupvalue in self.lookupvalues.all():
if lookupvalue.id == value:
valid = True
Expand Down

1 comment on commit 5bc1055

@oliverroick
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #101

Please sign in to comment.