import scrapy
from peewee import *
db = MySQLDatabase("test",host='127.0.0.1',port=3306,user='test', passwd='test', charset='utf8')
class GoodsItem(scrapy.Item):
# define the fields for your item here like:
one = scrapy.Field()
two = scrapy.Field()
three = scrapy.Field()
class Goods(Model):
# one 是主键
one = CharField(verbose_name="one", max_length=100, primary_key=True, null=False)
two = CharField(verbose_name="two", max_length=200, null=False)
three = CharField(verbose_name="three",max_length=80, null=False) null=False)
class Meta:
database = db