@staff_member_required
def admin_keywords_submit(request):
 (keyword_ids, titles) = ([], [])
 remove = punctuation.replace(u'-', u'')
 for title in request.POST.get(u'text_keywords', u'').split(u','):
  title = u''.join([c for c in title if (c not in remove)]).strip()
  if title:
   (kw, created) = Keyword.objects.get_or_create_iexact(title=title)
   keyword_id = str(kw.id)
   if (keyword_id not in keyword_ids):
    keyword_ids.append(keyword_id)
    titles.append(title)
 return HttpResponse((u'%s|%s' % (u','.join(keyword_ids), u', '.join(titles))), content_type=u'text/plain')

@ staff_member_required def admin_keywords_submit ( request ) : ( keyword_ids , titles ) = ( [ ] , [ ] ) remove = punctuation . replace ( u'-' , u'' ) for title in request . POST . get ( u'text_keywords' , u'' ) . split ( u',' ) : title = u'' . join ( [ c for c in title if ( c not in remove ) ] ) . strip ( ) if title : ( kw , created ) = Keyword . objects . get_or_create_iexact ( title = title ) keyword_id = str ( kw . id ) if ( keyword_id not in keyword_ids ) : keyword_ids . append ( keyword_id ) titles . append ( title ) return HttpResponse ( ( u'%s|%s' % ( u',' . join ( keyword_ids ) , u', ' . join ( titles ) ) ) , content_type = u'text/plain' )
adds any new given keywords from the custom keywords field in the admin .