Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/BE-35: Art Item Category #358

Merged
merged 5 commits into from
Dec 18, 2022
Merged

Feature/BE-35: Art Item Category #358

merged 5 commits into from
Dec 18, 2022

Conversation

BElifb
Copy link
Contributor

@BElifb BElifb commented Dec 17, 2022

  • Renamed type field of ArtItem model as category.
  • Created predefined choices for category. Updated model class.
  • Updated serializer and swagger documentation.
  • Tested through admin site and swagger.
  • Currently ArtItem APIs are operating with 2 character codes of the categories. Such as;
    • { "id": 5, "owner": { "id": 2, "username": "string", "name": "st", "surname": "ring", "profile_path": "avatar/default.png" }, "title": "newartitem", "description": "good stuff", "category": "PR", "tags": [], "artitem_path": "artitem/defaultart.jpg", "likes": 0, "created_at": "2022-12-16T23:25:43.904293Z", "isLiked": false }
    • Where codes are as following:

ARCHITECTURE = 'AR', _('Architecture')
SCULPTURE = 'SC', _('Sculpture')
DRAWING = 'DR', _('Drawing')
PHOTOGRAPHY = 'PH', _('Photography')
PRINTS = 'PR', _('Prints')
PAINTING_ACRYLIC = 'PA', _('Painting/Acrylic')
PAINTING_OILPAINT = 'PO', _("Painting Oilpaint")
PAINTING_WATERCOLOUR = 'PW', _("Painting Watercolour")
PAINTING_DIGITAL = 'PD', _("Painting Digital")
PAINTING_MURAL = 'PM', _("Painting Mural")
PAINTING_GOUACHE = 'PG', _("Painting Gouache")
PAINTING_PASTEL = 'PP', _("Painting Pastel")
PAINTING_ENCAUSTIC = 'PE', _("Painting Encaustic")
PAINTING_FRESCO = 'PF', _("Painting Fresco")
PAINTING_SPRAY = 'PS', _("Painting Spray")
PAINTING_OTHER = 'OP', _("Painting Other")
OTHER = 'OT', _("Other")

  • It is easy enough switching to communicating with human readable formats of the categories ("Other" instead of "OT" ). Frontend let me know which you prefer @kostanya

@BElifb BElifb added Effort: Low This issue can be easily handled Priority: Medium This issue should be handled, if there isn't any high priority issue Status: Completed The issue is closed Coding The issue is related with coding Team: Backend issues related to backend labels Dec 17, 2022
@BElifb BElifb self-assigned this Dec 17, 2022
@BElifb BElifb changed the title Feature/be 35 Feature/BE-35: Art Item Category Dec 17, 2022
@BElifb BElifb mentioned this pull request Dec 17, 2022
3 tasks
@KarahanS
Copy link
Contributor

KarahanS commented Dec 17, 2022

Tested the artitem APIs using Postman. Even if I provide a suitable category, it defaults to OT. I feel like serializer cannot associate given input string with one of the Enum types. Could you test that as well @BElifb?

KarahanS
KarahanS previously approved these changes Dec 17, 2022
@KarahanS KarahanS dismissed their stale review December 17, 2022 16:52

possible error spotted

@BElifb
Copy link
Contributor Author

BElifb commented Dec 17, 2022

  • I just tested artitems/me/upload API with the following input;
    • { "title": "Portrait of Joel Miller", "description": "Joel Miller from TLOU universe.", "category": "PW", "tags": [ ], "artitem_image": "base64 string" } (not included image encoding here to avoid clutter)
  • I was able to see Painting Watercolour as the category in the admin site as expected. Could you specify what went wrong and with which API endpoint? @KarahanS

@KarahanS
Copy link
Contributor

KarahanS commented Dec 18, 2022

Now I got it, you have changed the name of the field from type to category but I missed that part. Approved now. I added two new categories: Sketch and Poster - fyi.

@KarahanS
Copy link
Contributor

@kostanya We change the field name type to category for artitems btw. You may need to update some API calls accordingly.

@KarahanS KarahanS added the Approved This work is reviewed and approved by a team member label Dec 18, 2022
@BElifb BElifb merged commit af849ee into master Dec 18, 2022
@KarahanS KarahanS deleted the feature/BE-35 branch December 18, 2022 10:47
@kostanya
Copy link
Contributor

@KarahanS I'll make modifications accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved This work is reviewed and approved by a team member Coding The issue is related with coding Effort: Low This issue can be easily handled Priority: Medium This issue should be handled, if there isn't any high priority issue Status: Completed The issue is closed Team: Backend issues related to backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants