タグ付けされた質問 「django-custom-manager」

3
Django動的モデルフィールド
一部のユーザーが独自のデータフィールドを(管理者経由で)定義して、フォームで追加のデータを収集し、そのデータについてレポートできるマルチテナント型アプリケーションに取り組んでいます。後者のビットはJSONFieldを優れたオプションにしないので、代わりに次の解決策があります: class CustomDataField(models.Model): """ Abstract specification for arbitrary data fields. Not used for holding data itself, but metadata about the fields. """ site = models.ForeignKey(Site, default=settings.SITE_ID) name = models.CharField(max_length=64) class Meta: abstract = True class CustomDataValue(models.Model): """ Abstract specification for arbitrary data. """ value = models.CharField(max_length=1024) class Meta: abstract = …
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.