Skip to content

Basic api draft#18

Closed
WindShiba wants to merge 1 commit intodevfrom
Draft_api
Closed

Basic api draft#18
WindShiba wants to merge 1 commit intodevfrom
Draft_api

Conversation

@WindShiba
Copy link
Copy Markdown
Contributor

No description provided.

@oddstr13 oddstr13 changed the title Basic api draft. Basic api draft Nov 25, 2024
Copy link
Copy Markdown
Contributor

@oddstr13 oddstr13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all, I think we should just create a simple "dummy" endpoint for now.

Comment thread backendapi/models.py


# this is the Attendant model, im unsure if we need more data? Maby date of birth? => 18 years maby?
class Attendant(models.Model):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Models should be implemented in the database repo.
We have exactly none of the identifying information listed here for attendants, but we could use some of it for the crew interface.

Comment thread backendapi/views.py


@api_view(["GET", "POST", "PUT", "PATCH", "DELETE"])
def api_get(request, pk=None):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, to get started on the frontend, it would make sense to just return some simple test data (hardcoded Response data, possibly a few mutations based on the provided input variable)

Comment thread backendapi/serializers.py
# Change the model later depending on requirements. Please tell me what, and il remake the model later to fit requirements.


class AttendantAdmin(serializers.ModelSerializer): # defined a serialiser class
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for why this is named AttendantAdmin?

@@ -0,0 +1,31 @@
# Generated by Django 5.1.3 on 2024-11-25 08:50
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong repo, see other comment

Comment thread backendapi/admin.py

# Register your models here.

class AttendantAdmin(admin.ModelAdmin):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong repo, see other comment

@oddstr13 oddstr13 mentioned this pull request Nov 25, 2024
@oddstr13 oddstr13 closed this in #19 Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants