django 数据库迁移指令

# rbac/models.py
class Role(models.Model):...

class User(models.Model):
	# name = models.CharField(max_length=12)
	# password = models.CharField(max_length=12)
	roles = models.ManyToManyField(Role)	# 直接写对应的类名,字符串形式反射是找不到的
	# user = models.OneToOneField('Userinfo')
	class Meta:
		abstract = True	 # 执行数据库迁移指令的时候,不会将这个类生成
# sales/models.py
class UserInfo(User):
	username = models.CharField(max_length=16)
	password = models.CharField(max_length=32)
	is_active = models.BoolenField(default=True)

	def __str__(models.Model):
		return self.username