我在Windows Phone 8.1应用程序中显示两列gridview时遇到问题.
这是我的预期结果:

<Canvas>
<Grid Tapped="Grid_Tapped">
<Grid.RowDefinitions>
<RowDefinition Height="93*"/>
<RowDefinition Height="35*"/>
</Grid.RowDefinitions>
<Pivot Name="centerPivot" Margin="0,109,0,0" Grid.Row="0" Grid.RowSpan="2" Canvas.ZIndex="2" Tapped="centerPivot_Tapped">
<PivotItem Name="FindPivotItem" Margin="11,10,13,0.333">
<PivotItem.Header>
<Grid>
<TextBlock Name="FindTitle" FontSize="31" Text="Store Finds" Foreground="#FF878787" FontFamily="Global User Interface" />
</Grid>
</PivotItem.Header>
<!--<GridView
ScrollViewer.VerticalScrollBarVisibility="Visible"
ItemTemplate="{Binding ManyListingStyle}"
Grid.Row="1"
VerticalAlignment="Top"
VerticalContentAlignment="Top" Height="450" Margin="0,0,-0.167,0"
/>-->
<GridView
Name="GridGridView"
ItemsSource="{Binding}"
Grid.Row="4"
IsSwipeEnabled="True"
SelectionMode="Single"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollMode="Enabled" Margin="0,0,0,0.333" HorizontalAlignment="Left"
>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Vertical"
MaximumRowsOrColumns="3"
>
</WrapGrid>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<GridView.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Left" Width="190" Height="240">
<Rectangle Fill="#FFF4F4F5" HorizontalAlignment="Left" …Run Code Online (Sandbox Code Playgroud) 如果我打印request.POST.username和request.POST.password,我得到正确的数据.但我无法验证表格.我无法得到cleaned_data.
views.py
def login(request):
if request.method == 'POST':
form = LoginForm(request.POST)
if form.isValid():
print "coming"
return render_to_response('html/index.html')
else:
form = LoginForm()
c = {'logInForm': form, }
return render_to_response('html/index.html', c, RequestContext(request))
Run Code Online (Sandbox Code Playgroud)
forms.py
from django import forms
class LoginForm(forms.Form):
username = forms.EmailField()
password = forms.CharField(max_length=50)
Run Code Online (Sandbox Code Playgroud)
的index.html
<!DOCTYPE html>
<html>
<head>
.....
</head>
<body>
<div class="container">
<form class="form-signin" action="login" method="post">{% csrf_token %}
{{ logInForm.as_p }}
<input type="submit" value="Submit"/>
</form>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)