Hello every:
http://jinja.pocoo.org/docs/2.9/templates/#variables
In Django template language:
if {{ var }} doesn't exist,it will print nothing,the jinja2's document said
it will print noting default,however it print "{{ var }}"?how to change it
to noting whithout chang tags "{{ var }}".
ps : {{
dj_pagination say:
1.
If it’s not already added in your setup, add the request context
processor. Note that context processors are set by default implicitly, so
to set them explicitly, you need to copy and paste this code into your
under the value TEMPLATE_CONTEXT_PROCESS
n\u5168\u90e8\n\U0001f436\n
在 2017年8月1日星期二 UTC+8上午10:59:12,李余通写道:
>
> Hello,Everyone,
> I know charField can use
>
> forms.TextInput(attrs={'class' : 'form-control',
> }),
> or
> forms.Textarea(attrs={'class' : "form-control",
&g
Hello,Everyone,
I know charField can use
forms.TextInput(attrs={'class' : 'form-control',
}),
or
forms.Textarea(attrs={'class' : "form-control",
'rows' : 3 ,
})
to set widgets
but ModelChoiceField?
I have no idea,Django telled me "'module' object has no attrib
.com/en/1.8/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other
>
> >
> > Cheers
> >
> > Tom
> >
> > On Tue, Jul 18, 2017 at 10:19 AM, 李余通 > wrote:
> >> My mind is here:
> >>
> >> class Regi
her field, you do so in the clean()
> method:
>
> https://docs.djangoproject.com/en/1.8/ref/forms/validation/
>
> and in detail
>
>
> https://docs.djangoproject.com/en/1.8/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other
>
>
&
My mind is here:
class Register(forms.Form):
passwd =
forms.CharField(max_length=20,label='密码',widget=forms.PasswordInput)
repasswd =
forms.CharField(max_length=20,label='重复密码',widget=forms.PasswordInput)
def clean_passwd(self):
passwd = self.cleaned_data['passwd']
repasswd = se
How to extend User?I find many ways;
1. Use Profile
eg:
class UserProfile(models.Model):
user = models.OneToOneField(User)
major = models.TextField(default='', blank=True)
This way is easy to understand,However,it will create a new table in sql,I
heard this will add System burden.
2
uot; header, that would be enough. Why do you post
> data manually though?
>
> On 15 Jun 2017, at 16:33, 李余通 > wrote:
>
> Ture,my way is wrong,should i send cookies?
>
> 在 2017年6月15日星期四 UTC+8下午9:29:17,Александр Христюхин写道:
>>
>> CSRF token value is passed in D
Ture,my way is wrong,should i send cookies?
在 2017年6月15日星期四 UTC+8下午9:29:17,Александр Христюхин写道:
>
> CSRF token value is passed in Django's response headers.
> And anyway, you're no supposed to post data like that. Do you do that in
> tests?
>
> On 15 Jun 2017, at 16:20, liyutong...@gmail.com w
10 matches
Mail list logo