問題タブ [django-custom-manager]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
django - Django 管理者エラー「以下のエラーを修正してください。」
カスタム BaseUserManager を作成してユーザーを作成しましたが、django 管理パネルからユーザーを追加すると「以下のエラーを修正してください」というエラーが表示され、何が問題なのかがわかりません。
Models.py:
Admin.py ファイル:
誰かが私が間違っていることを提案できますか? 管理パネルからユーザーを追加すると、常にエラーが発生します。baseusermanager で初めて作業しているため、わかりません。
django - Django3/DRF: カスタム クエリセット __init__() が複数回呼び出されます。[連鎖クエリセットが適用されます]
よろしくお願いします!
カスタムクエリセットを作成しましたが、その__init__()
メソッドが複数回呼び出されることに気付きました。
私も申し込んでいることを考慮に入れましょうQueryset Chaining
models.py
manager.py
serializers.py
ビュー.py
TodoQueryset().__init__() print ステートメントの出力
現時点では Todo が 1 つしか作成されていませんが、なぜ 3 回実行されるのかわかりません ( で 5 回実行されます/api/todos/1/
) 。
この問題に光を当ててくれる人はいますか?
django - django.db.utils.IntegrityError: UNIQUE constraint failed: authentication_user.email
I am trying create user through an API, But i am struck on above error.
Below are the code of the User and its manager. Here, I am creating custom user model.
Below is serializers.py file.
Here is POST request in views.py
I am new to drf. Kindly help me out, thanks.