mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-21 03:19:52 +00:00
[Update] 修改session
This commit is contained in:
16
apps/orgs/mixins/forms.py
Normal file
16
apps/orgs/mixins/forms.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
|
||||
from django import forms
|
||||
|
||||
__all__ = ['OrgModelForm']
|
||||
|
||||
|
||||
class OrgModelForm(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
for name, field in self.fields.items():
|
||||
if not hasattr(field, 'queryset'):
|
||||
continue
|
||||
model = field.queryset.model
|
||||
field.queryset = model.objects.all()
|
Reference in New Issue
Block a user