Django模型:TypeError:元组索引必须是整数或切片,而不是str

时间:2019-09-04 14:23:15

标签: django postgresql django-models

我的应用程序是使用Python3,Django和PostgreSQL开发的。

当我尝试执行以下查询时

Interaction.Behaviors

我遇到错误

  

TypeError:元组索引必须是整数或切片,而不是str

我正在按照以下方式执行查询。

                    <Interactivity:Interaction.Behaviors>
                        <Interactions:DataTriggerBehavior
                            Binding="{x:Bind IsPlaying}"
                            ComparisonCondition="Equal"
                            Value="True">
                            <Interactions:ChangePropertyAction
                                PropertyName="Foreground"
                                TargetObject="{Binding ElementName=ArtistTextBlock}"
                                Value="{StaticResource SystemColorHighlightColor}" />
                        </Interactions:DataTriggerBehavior>
                        <Interactions:DataTriggerBehavior
                            Binding="{x:Bind IsPlaying}"
                            ComparisonCondition="Equal"
                            Value="False">
                            <Interactions:DataTriggerBehavior
                                Binding="{Binding CurrentTheme}"
                                ComparisonCondition="Equal"
                                Value="Dark">
                                <Interactions:ChangePropertyAction
                                    PropertyName="Foreground"
                                    TargetObject="{Binding ElementName=ArtistTextBlock}"
                                    Value="White" />
                            </Interactions:DataTriggerBehavior>                                
                            <Interactions:DataTriggerBehavior
                                Binding="{Binding CurrentTheme}"
                                ComparisonCondition="NotEqual"
                                Value="Dark">
                                <Interactions:ChangePropertyAction
                                    PropertyName="Foreground"
                                    TargetObject="{Binding ElementName=ArtistTextBlock}"
                                    Value="Black" />
                            </Interactions:DataTriggerBehavior>
                        </Interactions:DataTriggerBehavior>
                    </Interactivity:Interaction.Behaviors>

我们非常感谢您为解决以下问题提供的帮助。

0 个答案:

没有答案