Skip to content

Instantly share code, notes, and snippets.

@fengxuway
Created August 2, 2016 08:48
Show Gist options
  • Save fengxuway/c3df66a82737b01d20328e126d917473 to your computer and use it in GitHub Desktop.
Save fengxuway/c3df66a82737b01d20328e126d917473 to your computer and use it in GitHub Desktop.
django forms类获取列表数据
class FileTransferForm(forms.Form):
name = forms.CharField()
file_path = forms.CharField()
dest = forms.CharField()
user = forms.CharField()
server_ids = forms.CharField()
def clean_server_ids(self):
return self.data.getlist('server_ids', [])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment