Commits

Klaus Laube committed 289191d

Admin entries created.

  • Participants
  • Parent commits 5114de6

Comments (0)

Files changed (6)

File apps/friendships/admin.py

+from django.contrib import admin
+
+from friendships.models import Friendship
+
+class FriendshipAdmin(admin.ModelAdmin):
+    list_display = ('sender', 'recipient', 'is_active', )
+    search_fields = ('sender__username', 'recipient__username', )
+    list_filter = ('is_active', )
+
+
+admin.site.register(Friendship, FriendshipAdmin)

File apps/games/admin.py

+from django.contrib import admin
+from django.utils.translation import gettext as __
+
+from games.models import Game
+
+class GameAdmin(admin.ModelAdmin):
+    list_display = ('team', 'get_opponent', 'place', 'date', 'hour', 'is_active', )
+    search_fields = ('team__name', 'place__name', 'opponent_str', )
+    list_filter = ('date', 'is_active', )
+
+    fieldsets = (
+        (None, {
+            'fields': ('team', 'opponent', 'opponent_str', ),
+        }),
+
+        (__('Local'), {
+            'fields': ('place', 'date', 'hour', ),
+        }),
+
+        (__('Adicionais'), {
+            'fields': ('observation', 'is_active', ),
+        }),
+    )
+
+
+admin.site.register(Game, GameAdmin)

File apps/notificate/admin.py

+# -*- coding: utf-8 -*-
+
+from django.contrib import admin
+from django.utils.translation import gettext as __
+
+from notificate.models import Notification
+
+class NotificationAdmin(admin.ModelAdmin):
+    list_display = ('sender', 'recipient', 'subject', 'created_date', 'was_read', )
+    search_fields = ('sender__username', 'recipient__username', 'subject', )
+    list_filter = ('created_date', 'was_read', )
+
+    fieldsets = (
+        (None, {
+            'fields': ('sender', 'recipient', )
+        }),
+
+        (__('Mensagem'), {
+            'fields': ('subject', 'message', ),
+        }),
+    )
+
+
+admin.site.register(Notification, NotificationAdmin)

File apps/notificate/models.py

     )
     recipient = models.ForeignKey(
         User,
-        verbose_name=_(u'Destinatário'),
+        verbose_name=__(u'Destinatário'),
         related_name='recipient',
     )
-    subject = models.CharField(_(u'Título'), max_length=100)
+    subject = models.CharField(__(u'Título'), max_length=100)
     message = models.TextField(_('Mensagem'))
     created_date = models.DateTimeField(
-        _(u'Data criação'),
+        __(u'Data criação'),
         default=datetime.now(),
     )
     was_read = models.BooleanField(_('Mensagem lida'), default=False)

File apps/places/admin.py

+from django.contrib import admin
+
+from places.models import Place
+
+class PlaceAdmin(admin.ModelAdmin):
+    list_display = ('name', 'city', 'founder', )
+    search_fields = ('name', 'city', 'founder', )
+
+
+admin.site.register(Place, PlaceAdmin)

File apps/teams/admin.py

+from django.contrib import admin
+
+from teams.models import Team
+
+class TeamAdmin(admin.ModelAdmin):
+    list_display = ('name', 'founder', 'founded_in', 'city', )
+    search_fields = ('name', 'about', )
+    list_filter = ('founded_in', )
+
+
+admin.site.register(Team, TeamAdmin)