Skip to content

Commit

Permalink
add fields __all__
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad88me committed Sep 17, 2023
1 parent a797a3e commit a222758
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/django-rest-gen/apigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def write_class_serializer(class_name, fpath, write=False):
"""
content = f"""\nclass {class_name}Serializer(serializers.ModelSerializer):\n
class Meta:
model = {class_name}\n\n"""
model = {class_name}
fields = '__all__'\n\n"""
if write:
with open(fpath, "a") as f:
f.write(content)
Expand Down

0 comments on commit a222758

Please sign in to comment.