[UPDT] Pylint updates
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
||||
from dynamic_fields.models import Choice, DynamicField
|
||||
|
||||
# Register your models here.
|
||||
|
||||
|
||||
admin.site.register(DynamicField)
|
||||
admin.site.register(Choice)
|
||||
|
||||
@@ -4,11 +4,12 @@ dynamic_fields/forms.py
|
||||
|
||||
from django import forms
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from base.forms import ModelForm
|
||||
from horilla.horilla_middlewares import _thread_locals
|
||||
from dynamic_fields import models
|
||||
from dynamic_fields.df_not_allowed_models import DF_NOT_ALLOWED_MODELS
|
||||
from dynamic_fields.models import DynamicField
|
||||
from horilla.horilla_middlewares import _thread_locals
|
||||
|
||||
|
||||
class DynamicFieldForm(ModelForm):
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import logging
|
||||
from django.db import connection
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.db import connection
|
||||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
||||
from simple_history.models import HistoricalRecords
|
||||
from dynamic_fields.models import DynamicField
|
||||
|
||||
from dynamic_fields.methods import column_exists
|
||||
from dynamic_fields.models import DynamicField
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import logging
|
||||
from django.db import models
|
||||
from django.db import connection
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.db import connection, models
|
||||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
||||
from simple_history.models import HistoricalRecords
|
||||
|
||||
from dynamic_fields.methods import column_exists
|
||||
from dynamic_fields.models import DynamicField
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import logging, re
|
||||
import logging
|
||||
import re
|
||||
|
||||
from django import forms
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.core.management import call_command
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.core.management import call_command
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from dynamic_fields.df_not_allowed_models import DF_NOT_ALLOWED_MODELS
|
||||
from horilla.horilla_middlewares import _thread_locals
|
||||
|
||||
|
||||
from horilla_automations.methods.methods import get_model_class
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
"""
|
||||
dynamic_fields/signals.py
|
||||
"""
|
||||
from django.dispatch import receiver
|
||||
|
||||
from django.core.management import call_command
|
||||
from django.db.models.signals import pre_delete
|
||||
from django.dispatch import receiver
|
||||
|
||||
from dynamic_fields.models import DynamicField
|
||||
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<div class="oh-switch" style="width: 30px">
|
||||
{{ field|add_class:'oh-switch__checkbox' }}
|
||||
</div>
|
||||
{% else %}
|
||||
{% else %}
|
||||
<div id="dynamic_field_{{field.name}}">
|
||||
{{ field|add_class:'form-control' }}
|
||||
{{ field.errors }}
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
<div class="oh-hover-btn-drawer">
|
||||
{% if form.df_user_has_change_perm %}
|
||||
<button
|
||||
hx-get="{% url "edit-verbose-name" widget.attrs.pk %}?df_model_path={{form.df_form_model_path}}"
|
||||
hx-get="{% url "edit-verbose-name" widget.attrs.pk %}?df_model_path={{form.df_form_model_path}}"
|
||||
hx-target="[id='dfModalBody{{ form.df_form_model_path }}']"
|
||||
onclick="$(`[id='dfModal{{ form.df_form_model_path }}']:first`).addClass('oh-modal--show')"
|
||||
type="button"
|
||||
class="oh-hover-btn__small"
|
||||
type="button"
|
||||
class="oh-hover-btn__small"
|
||||
onclick=""><ion-icon name="create-outline"></ion-icon></button>
|
||||
{% endif %}
|
||||
{% if form.df_user_has_delete_perm %}
|
||||
@@ -54,7 +54,7 @@
|
||||
window.location.reload()
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -63,4 +63,4 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
$("#{{view_id}}Form [name={{field_tuple.0}}]").val({{form.initial|get_item:field_tuple.0|safe}}).change()
|
||||
</script>
|
||||
|
||||
<form
|
||||
<form
|
||||
hidden
|
||||
id="modalButton{{field_tuple.0}}Form"
|
||||
hx-get="/dynamic-path-{{field_tuple.0}}-{{request.session.session_key}}?dynamic_field={{field_tuple.0}}"
|
||||
@@ -50,7 +50,7 @@
|
||||
</button>
|
||||
</form>
|
||||
<script class="dynamic_{{field_tuple.0}}_scripts">
|
||||
$("#{{view_id}}Form [name={{field_tuple.0}}]").change(function (e) {
|
||||
$("#{{view_id}}Form [name={{field_tuple.0}}]").change(function (e) {
|
||||
values = $(this).val();
|
||||
if (!values) {
|
||||
values = ""
|
||||
@@ -70,12 +70,11 @@
|
||||
$("#reload-field{{field_tuple.0}}{{view_id}}").find('input[name=dynamic_initial]').val(values)
|
||||
}
|
||||
});
|
||||
$("#reload-field{{field_tuple.0}}{{view_id}}").submit(function (e) {
|
||||
$("#reload-field{{field_tuple.0}}{{view_id}}").submit(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).find("[name=dynamic_initial]").val();
|
||||
$(this).find("[name=dynamic_initial]").val();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ dynamic_fields/urls.py
|
||||
"""
|
||||
|
||||
from django.urls import path
|
||||
|
||||
from dynamic_fields import views
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
dynamic_fields/views.py
|
||||
"""
|
||||
|
||||
from django.contrib import messages
|
||||
from django.http import HttpResponse
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.contrib import messages
|
||||
from django.views.generic import View
|
||||
from horilla_views.generic.cbv.views import HorillaFormView
|
||||
from dynamic_fields import models, forms
|
||||
|
||||
from dynamic_fields import forms, models
|
||||
from dynamic_fields.methods import structured
|
||||
from horilla.decorators import login_required, permission_required
|
||||
from horilla_views.generic.cbv.views import HorillaFormView
|
||||
|
||||
|
||||
@method_decorator(login_required, name="dispatch")
|
||||
|
||||
Reference in New Issue
Block a user