[prev in list] [next in list] [prev in thread] [next in thread]
List: pyamf-users
Subject: Re: [pyamf-users] n00b help
From: oso che bol <ndlgroup1 () gmail ! com>
Date: 2009-07-17 15:21:24
Message-ID: 7d0336790907170821m15a4a06bua2ca568d9b7443b5 () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi,
Thanks for your guide, i got it worked.
When i tried Login example of Django, i got this issues:
2009-07-17 10:18:32 DEBUG django.__call__: AMF Request: <Envelope
amfVersion=0 clientType=3>
(u'/1', <Request target=u'login'>[u'username', u'password']</Request>)
</Envelope>
2009-07-17 10:18:32 DEBUG django.__call__: AMF Response: <Envelope
amfVersion=0 clientType=3>
(u'/1', <Response status=/onResult>*None*</Response>)
</Envelope>
I noticed that result is None and in flex site, nothing happen
Please help to give your advice.
Thanks and Regards,
-LN
On Fri, Jul 17, 2009 at 6:43 PM, Nick Joyce <nick@boxdesign.co.uk> wrote:
> Hi,
> You should be able to set the logger property on the gateway:
>
> gw.logger = loggerInstance
>
> For info on logging, I suggest you check out the docs [1]
>
> Cheers,
>
> Nick
>
> [1] - http://docs.python.org/library/logging.html
>
> On 17 Jul 2009, at 12:37, oso che bol wrote:
>
> Hi Nick,
> Thanks very much. It worked.
>
> Btw, could you please point me out how i got Log Output on server side
> because i imported logging module, but i don't know how to setting Logger
> module to expose log information
>
> Thanks,
> -LN
>
> On Fri, Jul 17, 2009 at 6:32 PM, Nick Joyce <nick@boxdesign.co.uk> wrote:
>
>>
>> On 17 Jul 2009, at 12:26, oso che bol wrote:
>>
>> Hi Nick,
>> Thanks you for your response.
>>
>> *My simpleview.py*
>> import logging
>>
>> import pyamf
>>
>> from pyamf import amf3
>>
>> AMF_NAME_SPACE = 'com.htk.simple'
>> amf3.use_proxies_default = True
>>
>> logging.basicConfig(level=logging.DEBUG,
>> format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s')
>>
>> def create_user(username, password, email):
>> user = User(username, password, email)
>> return user
>>
>> class User(object):
>> """
>> This model is associated with User in flex site
>> """
>> def __init__(self, username=None, password=None, email=None):
>> self.username = username
>> self.password = password
>> self.email = email
>> class UserService(object):
>> """
>> Define User-related service
>> """
>> def __init__(self, users):
>> self.users = users
>>
>> def get_user(self, username):
>> try:
>> return self.users[username]
>> except KeyError:
>> return "Username '%s' not found" % username
>>
>>
>> Here is the issue. Like I said, using the DjangoGateway supplies the http
>> request object like a standard view by default. You can switch this off by
>> setting expose_request=False or by adding the request object as the first
>> argument to the function.
>>
>> def get_user(self, request, username):
>> # ...
>>
>> Cheers,
>>
>> Nick
>>
>>
>> _______________________________________________
>> PyAMF users mailing list - users@pyamf.org
>> http://lists.pyamf.org/mailman/listinfo/users
>>
>>
> _______________________________________________
> PyAMF users mailing list - users@pyamf.org
> http://lists.pyamf.org/mailman/listinfo/users
>
>
>
> _______________________________________________
> PyAMF users mailing list - users@pyamf.org
> http://lists.pyamf.org/mailman/listinfo/users
>
>
[Attachment #5 (text/html)]
Hi,<div><br></div><div>Thanks for your guide, i got it \
worked.</div><div><br></div><div>When i tried Login example of Django, i got this \
issues:</div><div><div><br></div><div>2009-07-17 10:18:32 DEBUG django.__call__: AMF \
Request: <Envelope amfVersion=0 clientType=3></div> <div> (u'/1', \
<Request target=u'login'>[u'username', \
u'password']</Request>)</div><div></Envelope></div><div>2009-07-17 \
10:18:32 DEBUG django.__call__: AMF Response: <Envelope amfVersion=0 \
clientType=3></div> <div> (u'/1', <Response \
status=/onResult><b>None</b></Response>)</div><div></Envelope></div><div><br></div>I \
noticed that result is None and in flex site, nothing \
happen</div><div><br></div><div> Please help to give your advice.</div><div>Thanks \
and Regards,</div><div>-LN<br><div class="gmail_quote">On Fri, Jul 17, 2009 at 6:43 \
PM, Nick Joyce <span dir="ltr"><<a \
href="mailto:nick@boxdesign.co.uk">nick@boxdesign.co.uk</a>></span> wrote:<br> \
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;"><div style="word-wrap:break-word">Hi,<div><br></div><div>You \
should be able to set the logger property on the gateway:</div> \
<div><br></div><div>gw.logger = loggerInstance</div><div><br></div><div>For info on \
logging, I suggest you check out the docs \
[1]</div><div><br></div><div>Cheers,</div><div><br></div><div>Nick</div><div><br></div><div>[1] \
- <a href="http://docs.python.org/library/logging.html" \
target="_blank">http://docs.python.org/library/logging.html</a></div> \
<div><div></div><div class="h5"><div><br><div><div>On 17 Jul 2009, at 12:37, oso che \
bol wrote:</div><br><blockquote type="cite">Hi Nick,<div><br></div><div>Thanks very \
much. It worked.</div><div><br></div><div>Btw, could you please point me out how i \
got Log Output on server side because i imported logging module, but i don't know \
how to setting Logger module to expose log information</div> \
<div><br></div><div>Thanks,</div><div>-LN<br><br><div class="gmail_quote">On Fri, Jul \
17, 2009 at 6:32 PM, Nick Joyce <span dir="ltr"><<a \
href="mailto:nick@boxdesign.co.uk" \
target="_blank">nick@boxdesign.co.uk</a>></span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div \
style="word-wrap:break-word"><br><div><div><div></div><div><div>On 17 Jul 2009, at \
12:26, oso che bol wrote:</div> <br><blockquote type="cite">Hi \
Nick,<div><br></div><div>Thanks you for your response.<br><br></div><div><b>My \
simpleview.py</b></div><div><div>import logging \
</div> <div>import pyamf \
</div><div>from pyamf import amf3</div><div><br></div><div>AMF_NAME_SPACE = \
'com.htk.simple'</div> <div>amf3.use_proxies_default = \
True</div><div><br></div><div>logging.basicConfig(level=logging.DEBUG,</div><div> \
format='%(asctime)s %(levelname)-5.5s [%(name)s] \
%(message)s')</div><div><br></div><div>def create_user(username, password, \
email):</div> <div> user = User(username, password, email)</div><div> return \
user</div><div><br></div><div>class User(object):</div><div> \
"""</div><div> This model is associated with User in flex \
site</div> <div> """</div><div> def __init__(self, \
username=None, password=None, email=None):</div><div> self.username = \
username</div><div> self.password = password</div><div> self.email = \
email</div> <div>class UserService(object):</div><div> \
"""</div><div> Define User-related service</div><div> \
"""</div><div> def __init__(self, users):</div><div> \
self.users = users</div> </div></blockquote><blockquote type="cite"><div> <div> \
def get_user(self, username):</div><div> try:</div><div> return \
self.users[username]</div><div> except KeyError:</div><div> return \
"Username '%s' not found" % username</div> \
</div></blockquote><div><br></div></div></div><div><div>Here is the issue. Like I \
said, using the DjangoGateway supplies the http request object like a standard view \
by default. You can switch this off by setting expose_request=False or by adding the \
request object as the first argument to the function.</div> <div><br></div><div>def \
get_user(self, request, username):</div><div> # \
...</div><div><br></div><div>Cheers,</div><div><br></div><div>Nick</div></div></div><br></div><br>_______________________________________________<br>
PyAMF users mailing list - <a href="mailto:users@pyamf.org" \
target="_blank">users@pyamf.org</a><br> <a \
href="http://lists.pyamf.org/mailman/listinfo/users" \
target="_blank">http://lists.pyamf.org/mailman/listinfo/users</a><br> \
<br></blockquote></div><br></div> \
_______________________________________________<br>PyAMF users mailing list - <a \
href="mailto:users@pyamf.org" target="_blank">users@pyamf.org</a><br><a \
href="http://lists.pyamf.org/mailman/listinfo/users" \
target="_blank">http://lists.pyamf.org/mailman/listinfo/users</a><br> \
</blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
PyAMF users mailing list - <a href="mailto:users@pyamf.org">users@pyamf.org</a><br>
<a href="http://lists.pyamf.org/mailman/listinfo/users" \
target="_blank">http://lists.pyamf.org/mailman/listinfo/users</a><br> \
<br></blockquote></div><br></div>
_______________________________________________
PyAMF users mailing list - users@pyamf.org
http://lists.pyamf.org/mailman/listinfo/users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic