Skip to main content

反馈数据模型

Project description

xy_django_app_feedback

说明

通用反馈数据模型.

源码仓库

安装

# bash
pip install xy_django_app_feedback

使用

1. 直接引入
  • 1. 设置全局配置

在Django项目中的settings.py文件中加入如下配置 例如: settings.py

# settings.py

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "xy_django_app_resource",
    "xy_django_app_feedback",
    "Demo",
    "Resource",
    "Media",
]
  • 2. 运行项目
xy_web_server -w django makemigrations
xy_web_server -w django migrate
# 同步数据表
xy_web_server -w django start
# 启动工程后访问 http://127.0.0.1:8401/admin 验证信息管理系统
2. 自定义
  • 1. 创建Feedback模块

操作 样例工程

# bash
xy_web_server -w django startapp Feedback
# Feedback 模块创建在 source/Runner/Admin/Feedback 
  • 2. 设置全局配置

在Django项目中的settings.py文件中加入如下配置 例如: settings.py

# settings.py

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "Demo",
    "Resource",
    "Media",
    "xy_django_app_resource",
    "Feedback",
]
# models.py
from django.db import models
from django.utils.translation import gettext_lazy as _
from xy_django_app_feedback.abstracts import MAFeedback


class MFeedback(MAFeedback):
    images = models.ManyToManyField(
        "xy_django_app_resource.MImage",
        verbose_name=_("图片"),
        related_name="%(app_label)s_%(class)s_images",
        blank=True,
    )

    class Meta:
        verbose_name = _("反馈")
        verbose_name_plural = _("反馈")
        app_label = "Feedback"
# admin.py
from django.contrib import admin
from .models import *


@admin.register(MFeedback)
class FeedbackAdmin(admin.ModelAdmin):
    list_display = ("username", "text")
    filter_horizontal = ["images"]
  • 5. 运行项目
xy_web_server -w django makemigrations
xy_web_server -w django migrate
# 同步数据表
xy_web_server -w django start
# 启动工程后访问 http://127.0.0.1:8401/admin 验证账户管理系统
运行 样例工程

样例工程具体使用方式请移步 xy_web_server.git 下列仓库

许可证

xy_django_app_feedback 根据 <木兰宽松许可证, 第2版> 获得许可。有关详细信息,请参阅 LICENSE 文件。

捐赠

如果小伙伴们觉得这些工具还不错的话,能否请咱喝一杯咖啡呢?

Pay-Total

联系方式

微信: yuyangiit
邮箱: yuyangit.0515@qq.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xy_django_app_feedback-1.0.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

xy_django_app_feedback-1.0.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file xy_django_app_feedback-1.0.0.tar.gz.

File metadata

File hashes

Hashes for xy_django_app_feedback-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d738de015e230ce3523bf6a532b37bf0ef051f080ff7207f80a67b4aff93ae9c
MD5 9db7c10ffca27d38c6f3525fba84eb76
BLAKE2b-256 04ce3fa6625225cbfa850b68b23f24ee377633395290dac2255163d7733859f1

See more details on using hashes here.

File details

Details for the file xy_django_app_feedback-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xy_django_app_feedback-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a17748ad9ebb957e6296e35d649916a0e5cd284e28d7994ad5100c84e431ddbc
MD5 fc0bc15008f8999d72e6f7e6ffa95891
BLAKE2b-256 0f0bd5ceaaa3e9d5eae931edaab4ae08315cc427706bca7253d80179defb6c5d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page