Commit 78d0b1cb authored by nano's avatar nano

started integration of fiex in admin page

parent fe636f31
Pipeline #41 passed with stage
in 3 minutes and 13 seconds
from django.contrib import admin
from django.contrib.auth.models import User
from django.urls import path
from .models import Exchange, File
@admin.register(Exchange)
class ExchangeAdmin(admin.ModelAdmin):
def has_view_or_change_permission(self, request, obj=None):
......@@ -14,12 +15,22 @@ class ExchangeAdmin(admin.ModelAdmin):
return False
return True
def get_urls(self):
urls = super().get_urls()
my_urls = [
path('', self.my_view),
]
return my_urls + urls
def my_view(self, request):
pass
fieldsets = [
(None, {'fields' : ['password','created_by']}),
('Beschreibung', {'fields' : ['description','creation_date']}),
]
list_display = ['token','description','creation_date']
list_filter = ['created_by']
admin.site.register(Exchange,ExchangeAdmin)
......@@ -24,7 +24,7 @@ class Exchange(models.Model):
"""
token = models.CharField('access token', max_length=100,unique=True, default=gen_random_token(DEFAULT_TOKEN_LENGTH),editable=False)
# TODO securely safe password!
password = models.CharField('password required to access the exchange', max_length=100, null=True)
password = models.CharField('optional password', max_length=100, null=True)
created_by = models.ForeignKey(User,on_delete=models.CASCADE)
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment