#!/usr/bin/env python
# -*- coding:utf-8 -*-

"""
@author: Will
"""
from django import forms
from app01 import models

class ImportFrom(forms.Form):

        HOST_TYPE=((1,"001"),(2,"002"))  #替換爲文件
        host_type = forms.IntegerField(
            widget=forms.Select(choices=HOST_TYPE)
        )

        hostname = forms.CharField()

        def __init__(self,*args,**kwargs):
            super(ImportFrom,self).__init__(*args,**kwargs)
            HOST_TYPE=((1,"001"),(2,"002"))  #替換爲文件

            self.fields['host_type'].widget.choices = models.userInfo.objects.all().values_list("id","name")
            models.userInfo.objects.get()
            models.userInfo.objects.filter()













