DRF(Django-Rest-FrameWork)非主外键自关联
model.py
class SysPermission(models.Model):
id = models.CharField(db_column='Id', primary_key=True, max_length=50) # Field name made lowercase.
parentid = models.CharField(db_column='ParentId', max_length=50, blank=True, null=True) # Field name made lowercase.
layer = models.IntegerField(db_column='Layer', blank=True, null=True) # Field name made lowercase.
encode = models.CharField(db_column='EnCode', max_length=50, blank=True, null=True) # Field name made lowercase.
name = models.CharField(db_column='Name', max_length=50, blank=True, null=True) # Field name made lowercase.
jsevent = models.CharField(db_column='JsEvent', max_length=50, blank=True, null=True) # Field name made lowercase.
icon = models.CharField(db_column='Icon', max_length=50, blank=True, null=True) # Field name made lowercase.
url = models.CharField(db_column='Url', max_length=255, blank=True, null=True) # Field name made lowercase.
remark = models.CharField(db_column='Remark', max_length=255, blank=True, null=True) # Field name made lowercase.
type = models.IntegerField(db_column='Type', blank=True, null=True) # Field name made lowercase.
sortcode = models.IntegerField(db_column='SortCode', blank=True, null=True) # Field name made lowercase.
ispublic = models.IntegerField(db_column='IsPublic', blank=True, null=True) # Field name made lowercase.
isenable = models.IntegerField(db_column='IsEnable', blank=True, null=True) # Field name made lowercase.
isedit = models.IntegerField(db_column='IsEdit', blank=True, null=True) # Field name made lowercase.
deletemark = models.IntegerField(db_column='DeleteMark', blank=True, null=True) # Field name made lowercase.
createuser = models.CharField(db_column='CreateUser', max_length=50, blank=True, null=True) # Field name made lowercase.
createtime = models.DateTimeField(db_column=