bootstrap django crispy forms

69 prikaza
Preskoči na prvu nepročitanu poruku

clarkso...@gmail.com

nepročitano,
26. velj 2016. 10:39:0926. 02. 2016.
u Django users

A simple upload button is proving difficult to implement bootstrap and css on.... My attempt is as follows:

     class DocumentForm(forms.Form):
       docfile = forms.FileField(label='Choose')
       def __init__(self, *args, **kwargs): # don't particularly know or care about this and the below component....
         super(DocumentForm, self).__init__(*args, **kwargs) #but they are necessary to not get an error
         ButtonHolder(
           Div('docfile', style="background: black;", css_class="col-md-12", css_id="burton", template='home.html')
           ), #the Div part is what I'm most interested in- in order to be able to style the button.

Furthermore, having set the "css_class" to "burton", I have tried referencing it in a normal css file:

     .burton{
        ....
      }

but that too is obviously misguided??

Can someone tell me where I'm going wrong?

Mike Dewhirst

nepročitano,
26. velj 2016. 17:39:5826. 02. 2016.
u django...@googlegroups.com
This is probably wrong for your case but occasionally I have had success
overriding (or is that cascading?) style sheets by adding "!important"
to the pertinent item in my .css file.

On 27/02/2016 2:39 AM, clarkso...@gmail.com wrote:
> A simple upload button is proving difficult to implement bootstrap and
> css on.... My attempt is as follows:
>
> |classDocumentForm(forms.Form):docfile
> =forms.FileField(label='Choose')def__init__(self,*args,**kwargs): #
> don't particularly know or care about this and the below
> component....super(DocumentForm,self).__init__(*args,**kwargs) #but they
> are necessary to not get an
> errorButtonHolder(Div('docfile',style="background:
> black;",css_class="col-md-12",css_id="burton",template='home.html')),
> #the Div part is what I'm most interested in- in order to be able to
> style the button.|
>
> Furthermore, having set the "css_class" to "burton", I have tried
> referencing it in a normal css file:
>
> |.burton{....}|
>
> but that too is obviously misguided??
>
> Can someone tell me where I'm going wrong?
>
> --
> 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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@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/a3380d61-8348-4904-8f8b-83d5fdeab070%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a3380d61-8348-4904-8f8b-83d5fdeab070%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

James Schneider

nepročitano,
29. velj 2016. 19:39:2429. 02. 2016.
u django...@googlegroups.com
I answered your other email that had a very similar set of incorrect syntax, and provided direction there.


jarmova...@gmail.com

nepročitano,
1. ožu 2016. 05:28:4001. 03. 2016.
u django...@googlegroups.com
You should use #burton in your CSS, not .burton. You set the css_id, not the css_class to burton.

Jarmo

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Odgovori svima
Odgovori autoru
Proslijedi
0 novih poruka