New WaitingListEntry #33
|
@ -2,24 +2,27 @@
|
|||
|
||||
from django.contrib import admin
|
||||
|
||||
from . import models
|
||||
from .models import Membership
|
||||
benjaoming marked this conversation as resolved
Outdated
|
||||
from .models import MembershipType
|
||||
from .models import SubscriptionPeriod
|
||||
from .models import WaitingListEntry
|
||||
|
||||
|
||||
@admin.register(models.Membership)
|
||||
@admin.register(Membership)
|
||||
class MembershipAdmin(admin.ModelAdmin):
|
||||
"""Admin for Membership model."""
|
||||
|
||||
|
||||
@admin.register(models.MembershipType)
|
||||
@admin.register(MembershipType)
|
||||
class MembershipTypeAdmin(admin.ModelAdmin):
|
||||
"""Admin for MembershipType model."""
|
||||
|
||||
|
||||
@admin.register(models.SubscriptionPeriod)
|
||||
@admin.register(SubscriptionPeriod)
|
||||
class SubscriptionPeriodAdmin(admin.ModelAdmin):
|
||||
"""Admin for SubscriptionPeriod model."""
|
||||
|
||||
|
||||
@admin.register(models.WaitingListEntry)
|
||||
@admin.register(WaitingListEntry)
|
||||
class WaitingListEntryAdmin(admin.ModelAdmin):
|
||||
"""Admin for WaitingList model."""
|
||||
|
|
Loading…
Reference in a new issue
I'm against importing whole modules.
Don't we import whole modules everywhere all the time?
The idea is that the Django app is a domain-specific app so importing the models into the admin makes sense because almost all Models from that models module will have an admin. To me, this makes the code more readable than having lots of import statements.
Well, yes. I mostly use for instance
from django.db import models
in my ownmodels
modules, because it is a standard - but I actually would love to be more explicit everywhere.When push comes to shove it is all about preference. My preference is to explicitly import what is being used, to have a clear "in this module we are using these external things".
I also use
from django.db import models
inapp.models
but inapp.*
I usefrom app import models
because it's so convenient and it targets the domain-specific ideal of the app. As in, if you are import some othermodels
module, then something is wrong.I think having explicit imports is more readable and gives me an overview of what the module is interfacing with.
I think we can debate this forever :P
I would say that we should go with "do not change it just for the sake of changing it" and keep it as it was (but that is also in favorable for me ATM)
Alright you stubborn one ❤️