def _document_form_initial(document):
 return {'title': document.title, 'slug': document.slug, 'category': document.category, 'is_localizable': document.is_localizable, 'is_archived': document.is_archived, 'topics': Topic.objects.filter(document=document).values_list('id', flat=True), 'products': Product.objects.filter(document=document).values_list('id', flat=True), 'related_documents': Document.objects.filter(related_documents=document).values_list('id', flat=True), 'allow_discussion': document.allow_discussion, 'needs_change': document.needs_change, 'needs_change_comment': document.needs_change_comment}

def _document_form_initial ( document ) : return { 'title' : document . title , 'slug' : document . slug , 'category' : document . category , 'is_localizable' : document . is_localizable , 'is_archived' : document . is_archived , 'topics' : Topic . objects . filter ( document = document ) . values_list ( 'id' , flat = True ) , 'products' : Product . objects . filter ( document = document ) . values_list ( 'id' , flat = True ) , 'related_documents' : Document . objects . filter ( related_documents = document ) . values_list ( 'id' , flat = True ) , 'allow_discussion' : document . allow_discussion , 'needs_change' : document . needs_change , 'needs_change_comment' : document . needs_change_comment }
return a dict with the document data pertinent for the form .