mirror of
https://github.com/lemeow125/Django-NotesApp.git
synced 2025-05-16 11:38:11 +08:00
Made content field for note unlimited
This commit is contained in:
parent
ff7934407a
commit
428423c2cc
4 changed files with 22 additions and 3 deletions
|
@ -5,8 +5,9 @@ from notes.models import Note
|
|||
|
||||
class CustomUserSerializer(serializers.ModelSerializer):
|
||||
notes = serializers.PrimaryKeyRelatedField(
|
||||
many=True, queryset=Note.objects.all())
|
||||
many=True, allow_null=True, queryset=Note.objects.all())
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ['id', 'username', 'notes']
|
||||
fields = ['id', 'username', 'notes',]
|
||||
read_only_fields = ['id', 'notes']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue