add more docstrings

This commit is contained in:
Matthias 2022-05-30 20:22:58 +02:00
parent a7959fddf2
commit 71937a180c
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,5 @@
"""Admin for the common app."""
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
@ -6,6 +8,7 @@ import common.models
class SettingsAdmin(ImportExportModelAdmin):
"""Admin settings for InvenTreeSetting."""
list_display = ('key', 'value')
@ -18,6 +21,7 @@ class SettingsAdmin(ImportExportModelAdmin):
class UserSettingsAdmin(ImportExportModelAdmin):
"""Admin settings for InvenTreeUserSetting."""
list_display = ('key', 'value', 'user', )
@ -30,16 +34,19 @@ class UserSettingsAdmin(ImportExportModelAdmin):
class WebhookAdmin(ImportExportModelAdmin):
"""Admin settings for Webhook."""
list_display = ('endpoint_id', 'name', 'active', 'user')
class NotificationEntryAdmin(admin.ModelAdmin):
"""Admin settings for NotificationEntry."""
list_display = ('key', 'uid', 'updated', )
class NotificationMessageAdmin(admin.ModelAdmin):
"""Admin settings for NotificationMessage."""
list_display = ('age_human', 'user', 'category', 'name', 'read', 'target_object', 'source_object', )

View File

@ -161,6 +161,7 @@ class FileManager:
return headers
def col_count(self):
"""Return the number of columns in the file."""
if self.data is None:
return 0