merging changes

This commit is contained in:
rolux 2011-10-02 17:05:10 +00:00
commit 63cb6039d3
3 changed files with 11 additions and 7 deletions

View file

@ -20,8 +20,8 @@ class Command(BaseCommand):
def handle(self, **options): def handle(self, **options):
offset = 0 offset = 0
chunk = 100 chunk = 100
pos = models.Item.objects.count() count = pos = models.Item.objects.count()
while offset <= models.Item.objects.count(): while offset <= count:
for i in models.Item.objects.all().order_by('id')[offset:offset+chunk]: for i in models.Item.objects.all().order_by('id')[offset:offset+chunk]:
print pos, i.itemId print pos, i.itemId
i.save() i.save()

View file

@ -225,6 +225,7 @@ Positions
query = parse_query(data, request.user) query = parse_query(data, request.user)
qs = order_query(query['qs'], query['sort']) qs = order_query(query['qs'], query['sort'])
qs = qs.distinct()
if 'keys' in data: if 'keys' in data:
qs = qs[query['range'][0]:query['range'][1]] qs = qs[query['range'][0]:query['range'][1]]
response['data']['items'] = [p.json(data['keys'], request.user) for p in qs] response['data']['items'] = [p.json(data['keys'], request.user) for p in qs]

View file

@ -5,14 +5,17 @@
body { body {
text-align: center; text-align: center;
padding-top: 96px; padding-top: 96px;
background: #101010;
color: #F0F0F0;
} }
</style> </style>
<link rel="stylesheet" type="text/css" href="/static/oxjs/build/Ox.UI/css/Ox.UI.css"/>
<title>We'll be back in a minute</title>
</head> </head>
<body> <body class="OxThemeModern">
<img src="http://pan.do/png/pandora.256.png"> <img src="/static/png/logo256.png">
<p> <div style="padding-top: 8px">
We'll be back in a minute. We'll be back in a minute.
</p> </div>
</body> </body>