- if len(data) < limit:
- arts = picture.models.Picture.objects.filter(
- title__iregex='\m' + prefix).only('title', 'id', 'slug') # img?
- data.extend([
- {
- 'type': 'art',
- 'label': art.title,
- 'author': art.author_unicode(),
- 'url': art.get_absolute_url(),
- 'img': get_thumbnail(art.image_file, '72x72').url if art.image_file else '',
- }
- for art in arts[:limit - len(data)]
- ])