I have made an upload form button, that I need to be able to refers to tin 
my css code such that I can centre it on the web page. However the upload 
button is not constituted by any bootstrap like "btn" syntax, which is 
prevalent in example code. Instead is constituted by the following code:

#forms.py

class DocumentForm(forms.Form):
    docfile = forms.FileField(label='Select a  BAM file')

    ### no class or model declared####

And so I have taken some example code that I have tried to adapt into to my 
own code below and properly indented from the above code in forms.py.

    def __init__(self, *args, **kwargs):
       super(####INSERT_TYPE####, self).__init__(*args, **kwargs) #what should 
i specify as a type?
       self.helper = FormHelper()
       self.helper.layout = Layout(
          Fieldset(
              '<h2 class="text-center">Edit data about your blog</h2>',
              Div('description', css_class="col-md-12"),
          ),
          ButtonHolder(
             Submit(css_class='btn-lg'), # not sure if this line is necessary 
for my purposes
             css_class="text-center"),
          )

Above, I am not sure what I should put in the place of "###INSERT_TYPE###" 
or whether the "Submit(css_class='btn-lg')" is necessary for me as I simply 
need to be able to "centre the text".

My model for the upload is as follows:

class Document(models.Model):
   docfile = models.FileField(upload_to='BAMfile')

And the HTML

    {% load crispy_forms_tags %} at the top
    {% crispy form %} inside form tags

I just need to know how I centre the text in the middle of my page... I 
can't believe that it could be this complicated....

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/db89b078-b632-4b41-be14-8dddad6e9f08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to