示例#1
0
文件: ajax.py 项目: w121211/noodle
def _resp_tags(request, channel_id):
    resp = {
        'alert': None,
        'tags': [],
        }
    c = Channel.objects.get(id=channel_id)
    resp['tags'] = c.get_all_tags()
    return response(resp)
示例#2
0
文件: ajax.py 项目: w121211/noodle
def _get_channels(request):
    resp = {
        'alert': None,
        'channels': [],
        }
    qs = Channel.objects.filter(user=request.user)
    for channel in qs:
        resp['channels'].append(channel.to_json())
    return response(resp)