forked from sio2project/oioioi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "(no-ticket) Add team list view"
- Loading branch information
Showing
8 changed files
with
307 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
[ | ||
{ | ||
"pk": 1103, | ||
"model": "auth.user", | ||
"fields": { | ||
"username": "test_team1", | ||
"first_name": "Test", | ||
"last_name": "Team1", | ||
"is_active": true, | ||
"is_superuser": false, | ||
"is_staff": false, | ||
"last_login": "2012-07-31T20:27:58.768Z", | ||
"groups": [], | ||
"user_permissions": [], | ||
"password": "", | ||
"email": "[email protected]", | ||
"date_joined": "2012-07-31T20:27:58.768Z" | ||
} | ||
}, | ||
{ | ||
"pk": 1104, | ||
"model": "auth.user", | ||
"fields": { | ||
"username": "test_team2", | ||
"first_name": "Test", | ||
"last_name": "Team2", | ||
"is_active": true, | ||
"is_superuser": false, | ||
"is_staff": false, | ||
"last_login": "2012-07-31T20:27:58.768Z", | ||
"groups": [], | ||
"user_permissions": [], | ||
"password": "", | ||
"email": "[email protected]", | ||
"date_joined": "2012-07-31T20:27:58.768Z" | ||
} | ||
}, | ||
{ | ||
"pk": 1105, | ||
"model": "auth.user", | ||
"fields": { | ||
"username": "test_team_user", | ||
"first_name": "", | ||
"last_name": "", | ||
"is_active": true, | ||
"is_superuser": false, | ||
"is_staff": false, | ||
"last_login": "2012-07-31T20:27:58.768Z", | ||
"groups": [], | ||
"user_permissions": [], | ||
"password": "", | ||
"email": "", | ||
"date_joined": "2012-07-31T20:27:58.768Z" | ||
} | ||
}, | ||
{ | ||
"pk": 1, | ||
"model": "teams.team", | ||
"fields": { | ||
"name": "test_team", | ||
"login": "test_team_user", | ||
"user": [ | ||
"test_team_user" | ||
], | ||
"contest": "c", | ||
"join_key": "abrakadabra" | ||
} | ||
}, | ||
{ | ||
"pk": 1, | ||
"model": "teams.teamMembership", | ||
"fields": { | ||
"user": 1103, | ||
"team": 1105 | ||
} | ||
}, | ||
{ | ||
"pk": 2, | ||
"model": "teams.teamMembership", | ||
"fields": { | ||
"user": [ | ||
"test_team2" | ||
], | ||
"team": 1105 | ||
} | ||
} | ||
] |
93 changes: 93 additions & 0 deletions
93
oioioi/teams/migrations/0002_auto__add_field_teamsconfig_teams_list_visible.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# -*- coding: utf-8 -*- | ||
from south.utils import datetime_utils as datetime | ||
from south.db import db | ||
from south.v2 import SchemaMigration | ||
from django.db import models | ||
|
||
|
||
class Migration(SchemaMigration): | ||
|
||
def forwards(self, orm): | ||
# Adding field 'TeamsConfig.teams_list_visible' | ||
db.add_column(u'teams_teamsconfig', 'teams_list_visible', | ||
self.gf('oioioi.base.fields.EnumField')(default='NO', max_length=64), | ||
keep_default=False) | ||
|
||
|
||
def backwards(self, orm): | ||
# Deleting field 'TeamsConfig.teams_list_visible' | ||
db.delete_column(u'teams_teamsconfig', 'teams_list_visible') | ||
|
||
|
||
models = { | ||
u'auth.group': { | ||
'Meta': {'object_name': 'Group'}, | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), | ||
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) | ||
}, | ||
u'auth.permission': { | ||
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, | ||
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | ||
}, | ||
u'auth.user': { | ||
'Meta': {'object_name': 'User'}, | ||
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), | ||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), | ||
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), | ||
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) | ||
}, | ||
u'contenttypes.contenttype': { | ||
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, | ||
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | ||
}, | ||
u'contests.contest': { | ||
'Meta': {'object_name': 'Contest'}, | ||
'controller_name': ('oioioi.base.fields.DottedNameField', [], {'max_length': '255', 'superclass': "'oioioi.contests.controllers.ContestController'"}), | ||
'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), | ||
'default_submissions_limit': ('django.db.models.fields.IntegerField', [], {'default': '10', 'blank': 'True'}), | ||
'id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}) | ||
}, | ||
u'teams.team': { | ||
'Meta': {'object_name': 'Team'}, | ||
'contest': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contests.Contest']"}), | ||
'join_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}), | ||
'login': ('django.db.models.fields.CharField', [], {'max_length': '50'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), | ||
'user': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) | ||
}, | ||
u'teams.teammembership': { | ||
'Meta': {'unique_together': "(('user', 'team'),)", 'object_name': 'TeamMembership'}, | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'members'", 'to': u"orm['teams.Team']"}), | ||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}) | ||
}, | ||
u'teams.teamsconfig': { | ||
'Meta': {'object_name': 'TeamsConfig'}, | ||
'contest': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['contests.Contest']", 'unique': 'True'}), | ||
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'max_team_size': ('django.db.models.fields.IntegerField', [], {'default': '3'}), | ||
'modify_begin_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), | ||
'modify_end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), | ||
'teams_list_visible': ('oioioi.base.fields.EnumField', [], {'default': "'NO'", 'max_length': '64'}) | ||
} | ||
} | ||
|
||
complete_apps = ['teams'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% extends "base-with-menu.html" %} | ||
{% load i18n %} | ||
{% load pagination_tags %} | ||
|
||
{% block title %}{% trans "Teams" %}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<h2>{{ name }}</h2> | ||
<ul> | ||
{% for team in teams %} | ||
<li>{{ team.name }}</li> | ||
<ul> | ||
{% for member in team.members %} | ||
<li>{{ member }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endfor %} | ||
</ul> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters