我是C#和Asp.NET的新手: 我创建了一个模型,让用户在Asp.NET mvc 5中进行注册:
from con import Database
class LinkPipeline(object):
def __init__(self):
self.db=Database()
def process_item(self, item, spider):
query="""INSERT INTO links (title, location,company_name,posted_date,status,company_id,scraped_link,content,detail_link,job_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s,%s)"""
params=(item['title'], item['location'], item['company_name'], item['posted_date'], item['status'], item['company_id'], item['scraped_link'], item['content'], item['detail_link'],item['job_id'])
self.db.insert(query,params)
return item
我有问题:
public class Registration
{
public int ID { get; set; }
public String FirstName { get; set; }
public String LastName { get; set; }
public String occupation {get; set;}
public String RegistrationState { get; set;}
}
只取三个值(等待,接受,拒绝),让管理员只修改视图中的这个属性。答案 0 :(得分:1)
您可以使用枚举而不是字符串进行RegistrationState
public enum RegistrationState
{
waiting=1,
accepted=2,
refused=3
}