小编Tir*_*ton的帖子

谷歌应用引擎(python)令人困惑的类'对象没有属性'错误

我有2节课.
一个看起来像这样:

class Feed(db.Model):
    bid = db.StringProperty()
    title = db.StringProperty()
    url = db.StringProperty()
    datecreated = db.DateProperty(auto_now_add=True)
    voice = db.StringProperty()
    lastchecked = db.DateProperty(auto_now=True)
    language = db.StringProperty()
    active = db.BooleanProperty()
    posts = db.ListProperty(db.Key)
Run Code Online (Sandbox Code Playgroud)

另一个看起来像这样:

class Post(db.Model):
    title = db.StringProperty()
    postdate = db.DateTimeProperty()
    author = db.StringProperty()
    body = db.TextProperty()
    link = db.LinkProperty()
    hasmp3 = db.BooleanProperty()
    mp3location = db.StringProperty()
    processed = db.BooleanProperty()
    voice = db.StringProperty()
    length = db.FloatProperty()
    inprocess = db.BooleanProperty()
    haspict = db.BooleanProperty()
    pictures = db.ListProperty(db.Key)
Run Code Online (Sandbox Code Playgroud)

我试图通过附加这样的帖子来更新Feed:

blogid = cgi.escape(self.request.get('bid'))
postid = cgi.escape(self.request.get('pid')) …
Run Code Online (Sandbox Code Playgroud)

python google-app-engine

1
推荐指数
1
解决办法
1419
查看次数

在c#中运行时设置类属性会导致Visual Studio崩溃

在处理更大的wp7项目时,我一直遇到这个问题:

每当我在我的代码中设置属性时,它都会崩溃Visual Studio 2010.所以我决定做一个适当的测试来试图找出问题所在.以下代码是一个简短的wp7应用程序示例,以相同的方式具有相同的问题.每当代码尝试设置name属性时,它都会使Visual Studio崩溃.

注意:我没有安装加载项,当我尝试在安全模式下运行它时,我收到错误"此安装不支持项目类型"

任何帮助,将不胜感激

using System;
using System.Collections.Generic;
using System.Windows;
using Microsoft.Phone.Controls;

namespace propertytest
{
    public partial class MainPage : PhoneApplicationPage
    {
        public string name
        {
            get { return name; }
            set
            {
                //crash!
                if (value != name)
                {
                    name = value;
                    hi(name); 
                }
            }
        }
        void hi(string name)
        {
            MessageBox.Show("hi "+name);
        }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;
            this.Loaded += …
Run Code Online (Sandbox Code Playgroud)

c# wpf windows-phone-7

0
推荐指数
1
解决办法
629
查看次数

标签 统计

c# ×1

google-app-engine ×1

python ×1

windows-phone-7 ×1

wpf ×1