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

Dev #41

Closed
wants to merge 2 commits into from
Closed

Dev #41

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bartczak_tech/portfolio/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.contrib import admin

from .models import Hobby
from .models import Technology

admin.site.register(Hobby)
admin.site.register(Technology)
12 changes: 11 additions & 1 deletion bartczak_tech/portfolio/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@ class Hobby(models.Model):
class Meta:
verbose_name_plural = "Hobbies"

def __str__(self):
def __str__(self) -> str:
return self.name


class Technology(models.Model):
name = models.CharField(max_length=50, unique=True)
bartczak-pa marked this conversation as resolved.
Show resolved Hide resolved

class Meta:
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Consider adding an ordering option in the Meta class

Adding an ordering option (e.g., ordering = ['name']) could be helpful for consistently displaying technologies in alphabetical order without additional sorting in views or templates.

    class Meta:
        verbose_name_plural = "Technologies"
        ordering = ['name']

verbose_name_plural = "Technologies"

def __str__(self) -> str:
return self.name
Loading