Added current_players to Server.
This commit is contained in:
parent
cfa2f0181c
commit
569c5b73ee
@ -100,6 +100,7 @@ class Command(BaseCommand):
|
|||||||
defaults= dict(
|
defaults= dict(
|
||||||
game_url=data['game_url'],
|
game_url=data['game_url'],
|
||||||
site_url=data['site_url'] or '',
|
site_url=data['site_url'] or '',
|
||||||
|
current_players=data['player_count'],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
24
src/gameservers/migrations/0005_auto_20150218_2029.py
Normal file
24
src/gameservers/migrations/0005_auto_20150218_2029.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('gameservers', '0004_auto_20150218_1915'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='server',
|
||||||
|
options={'ordering': ['-current_players', 'title']},
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='server',
|
||||||
|
name='current_players',
|
||||||
|
field=models.PositiveIntegerField(default=0),
|
||||||
|
preserve_default=True,
|
||||||
|
),
|
||||||
|
]
|
||||||
@ -4,9 +4,10 @@ class Server(models.Model):
|
|||||||
title = models.CharField(max_length=255)
|
title = models.CharField(max_length=255)
|
||||||
game_url = models.URLField()
|
game_url = models.URLField()
|
||||||
site_url = models.URLField(blank=True)
|
site_url = models.URLField(blank=True)
|
||||||
|
current_players = models.PositiveIntegerField(default=0)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['title']
|
ordering = ['-current_players', 'title']
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user