Client.Data.UnderFlow error when get_users in vessesion example

View: New views
3 Messages — Rating Filter:   Alert me  

Client.Data.UnderFlow error when get_users in vessesion example

by oso che bol :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Joel,

I have try with your example vesession, i do create model Person:
class Person(models.Model):
    category_choices = (
        ('1', 'Adult'),
        ('2', 'Minor'),
    )
    gender_choices = (
        ('1', 'Male'),
        ('2', 'Female'),
    )
    user        = models.ForeignKey(User, related_name = 'person', unique=True,
                                blank = True, null = True)
    category    = models.CharField(max_length = 1, choices = category_choices)
    first_name  = models.CharField(max_length = 100)
    last_name   = models.CharField(max_length = 100)
    gender      = models.CharField(max_length=1, choices = gender_choices, blank = True, null = True)
    birthday    = models.DateField(blank = True, null = True)
    email       = models.EmailField(blank = True, null = True)
    address     = models.CharField(max_length = 100, blank = True, null = True)
    city        = models.CharField(max_length = 50, blank = True, null = True)
    state       = models.CharField(max_length = 50, blank = True, null = True)
    zipcode     = models.CharField(max_length = 5, blank = True, null = True)

    class Admin:
        list_display = ('last_name', 'first_name')
        save_on_top  = True
        list_filter  = ('category',)
    class Meta:
        verbose_name_plural = "People"
    def __unicode__(self):
        return '%s %s' % (self.first_name, self.last_name)

And created a view get_users 
def get_users(request):
    try:
        pyamf.register_class( Person, 'clients.models.Person' )
    except ValueError:
        print "Class already registerd"
    return User.objects.all()

And in my flex, i create a login form with username, password and login button. When click login button, i assume it do login by my understand way: get_users, get_one_user, and verify_credentials, is that right?

My Value Object:
[Bindable]
[RemoteClass(alias='django.contrib.auth.models.User')]
public class UserVO
{
    public var id:int;
            public var username:String;
            public var first_name:String;
            public var last_name:String;
            public var email:String;
            public var password:String;
            public var is_staff:Boolean;
            public var is_active:Boolean;
            public var is_superuser:Boolean;
            public var last_login:Date;
            public var date_joined:Date;        
            public function toString( ):String
            {
                return username;
            }
}

On flex site, i call:
  gateway = new NetConnection();
  gateway.connect("http://mysite.com/w/gateway/");
  gateway.addEventListener(NetStatusEvent.NET_STATUS, onConnected)
  var responder:Responder = new Responder(onGetUsersComplete);
  gateway.call("get_users", responder);

  public function onConnected(event:NetStatusEvent):void
   {
Alert.show("Infor:"+event.info.code);
   }

On the log on server, it could show a dictionary of user, but on Flex site, it run into error:
[NetStatusEvent type="netStatus" bubbles=false cancelable=false eventPhase=2 info=[object Object]]
Client.Data.UnderFlow

Please give me your advice

Much Thanks and Best Regards,
-LN

_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

Re: Client.Data.UnderFlow error when get_users in vessesion example

by lists-144 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could you create a new ticket with all sample code for this?


Cheers,

Thijs

On 20 Jul 2009, at 18:21, oso che bol wrote:

Dear Joel,

I have try with your example vesession, i do create model Person:
class Person(models.Model):
    category_choices = (
        ('1', 'Adult'),
        ('2', 'Minor'),
    )
    gender_choices = (
        ('1', 'Male'),
        ('2', 'Female'),
    )
    user        = models.ForeignKey(User, related_name = 'person', unique=True,
                                blank = True, null = True)
    category    = models.CharField(max_length = 1, choices = category_choices)
    first_name  = models.CharField(max_length = 100)
    last_name   = models.CharField(max_length = 100)
    gender      = models.CharField(max_length=1, choices = gender_choices, blank = True, null = True)
    birthday    = models.DateField(blank = True, null = True)
    email       = models.EmailField(blank = True, null = True)
    address     = models.CharField(max_length = 100, blank = True, null = True)
    city        = models.CharField(max_length = 50, blank = True, null = True)
    state       = models.CharField(max_length = 50, blank = True, null = True)
    zipcode     = models.CharField(max_length = 5, blank = True, null = True)

    class Admin:
        list_display = ('last_name', 'first_name')
        save_on_top  = True
        list_filter  = ('category',)
    class Meta:
        verbose_name_plural = "People"
    def __unicode__(self):
        return '%s %s' % (self.first_name, self.last_name)

And created a view get_users 
def get_users(request):
    try:
        pyamf.register_class( Person, 'clients.models.Person' )
    except ValueError:
        print "Class already registerd"
    return User.objects.all()

And in my flex, i create a login form with username, password and login button. When click login button, i assume it do login by my understand way: get_users, get_one_user, and verify_credentials, is that right?

My Value Object:
[Bindable]
[RemoteClass(alias='django.contrib.auth.models.User')]
public class UserVO
{
    public var id:int;
            public var username:String;
            public var first_name:String;
            public var last_name:String;
            public var email:String;
            public var password:String;
            public var is_staff:Boolean;
            public var is_active:Boolean;
            public var is_superuser:Boolean;
            public var last_login:Date;
            public var date_joined:Date;        
            public function toString( ):String
            {
                return username;
            }
}

On flex site, i call:
  gateway = new NetConnection();
  gateway.connect("http://mysite.com/w/gateway/");
  gateway.addEventListener(NetStatusEvent.NET_STATUS, onConnected)
  var responder:Responder = new Responder(onGetUsersComplete);
  gateway.call("get_users", responder);

  public function onConnected(event:NetStatusEvent):void
   {
Alert.show("Infor:"+event.info.code);
   }

On the log on server, it could show a dictionary of user, but on Flex site, it run into error:
[NetStatusEvent type="netStatus" bubbles=false cancelable=false eventPhase=2 info=[object Object]]
Client.Data.UnderFlow

Please give me your advice

Much Thanks and Best Regards,
-LN
_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users



_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

PGP.sig (201 bytes) Download Attachment

Re: Client.Data.UnderFlow error when get_users in vessesion example

by Joel Hooks-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That particular example uses a very old build of pyamf to function and could have any number of issues. I took the example down because f this, I realized that it is not valid anymore and will probably just cause frustration.


Joel Hooks (@jhooks)
http://joelhooks.com




On Jul 22, 2009, at 3:20 PM, Thijs Triemstra | Collab wrote:

Could you create a new ticket with all sample code for this?


Cheers,

Thijs

On 20 Jul 2009, at 18:21, oso che bol wrote:

Dear Joel,

I have try with your example vesession, i do create model Person:
class Person(models.Model):
    category_choices = (
        ('1', 'Adult'),
        ('2', 'Minor'),
    )
    gender_choices = (
        ('1', 'Male'),
        ('2', 'Female'),
    )
    user        = models.ForeignKey(User, related_name = 'person', unique=True,
                                blank = True, null = True)
    category    = models.CharField(max_length = 1, choices = category_choices)
    first_name  = models.CharField(max_length = 100)
    last_name   = models.CharField(max_length = 100)
    gender      = models.CharField(max_length=1, choices = gender_choices, blank = True, null = True)
    birthday    = models.DateField(blank = True, null = True)
    email       = models.EmailField(blank = True, null = True)
    address     = models.CharField(max_length = 100, blank = True, null = True)
    city        = models.CharField(max_length = 50, blank = True, null = True)
    state       = models.CharField(max_length = 50, blank = True, null = True)
    zipcode     = models.CharField(max_length = 5, blank = True, null = True)

    class Admin:
        list_display = ('last_name', 'first_name')
        save_on_top  = True
        list_filter  = ('category',)
    class Meta:
        verbose_name_plural = "People"
    def __unicode__(self):
        return '%s %s' % (self.first_name, self.last_name)

And created a view get_users 
def get_users(request):
    try:
        pyamf.register_class( Person, 'clients.models.Person' )
    except ValueError:
        print "Class already registerd"
    return User.objects.all()

And in my flex, i create a login form with username, password and login button. When click login button, i assume it do login by my understand way: get_users, get_one_user, and verify_credentials, is that right?

My Value Object:
[Bindable]
[RemoteClass(alias='django.contrib.auth.models.User')]
public class UserVO
{
    public var id:int;
            public var username:String;
            public var first_name:String;
            public var last_name:String;
            public var email:String;
            public var password:String;
            public var is_staff:Boolean;
            public var is_active:Boolean;
            public var is_superuser:Boolean;
            public var last_login:Date;
            public var date_joined:Date;        
            public function toString( ):String
            {
                return username;
            }
}

On flex site, i call:
  gateway = new NetConnection();
  gateway.connect("http://mysite.com/w/gateway/");
  gateway.addEventListener(NetStatusEvent.NET_STATUS, onConnected)
  var responder:Responder = new Responder(onGetUsersComplete);
  gateway.call("get_users", responder);

  public function onConnected(event:NetStatusEvent):void
   {
Alert.show("Infor:"+event.info.code);
   }

On the log on server, it could show a dictionary of user, but on Flex site, it run into error:
[NetStatusEvent type="netStatus" bubbles=false cancelable=false eventPhase=2 info=[object Object]]
Client.Data.UnderFlow

Please give me your advice

Much Thanks and Best Regards,
-LN
_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users