I am trying to indent text in a multiple choice field.
def __init__(self):
super(RegisterFull,self).__init__()
sectorList = Sector.objects.all()
sArray = []
for s in sectorList:
sArray.append((s.id," "+s.__unicode__()))
self.fields["subsector"].choices = sArray
I have tried this and
sArray.append((s.id," "+s.__unicode__()))
However, I couldn’t achieve what I wanted because the “&” character is replaced by & (of course) and empty space is trimmed. Why, when html page is created?
Could you suggest a way?
Thanks.
I’d suggest using cascading style sheets (CSS) to format the fields as you want. HTML is supposed to focus mainly on the layout of your document, while CSS can do the fine tuning of formating. So add a class to the widget of your Form;
e.g.,
and then have in CSS at the top of the template (or move to an separate style sheet)
If you really wanted, you could do something simpler like:
EDIT: To get your solution to work (with
)