Re: [web2py] Re: Error upload file on 2.6.4

2013-09-27 Thread Relsi Hur Maron
Cool! Thanks!!

2013/9/27 Niphlod 

> if your "now" is 2.6.4, then current trunk adds only bug fixes and no new
> (potentially untested) features.
>
>
> On Friday, September 27, 2013 4:31:15 PM UTC+2, Relsi Hur Maron wrote:
>>
>>
>> Thanks! Now is working.
>>
>> It is a production app, no problem to use the current trunk?
>>
>> Em sexta-feira, 27 de setembro de 2013 11h20min01s UTC-3, Niphlod
>> escreveu:
>>>
>>> try current trunk.
>>>
>>> Il giorno venerdì 27 settembre 2013 15:17:54 UTC+2, Relsi Hur Maron ha
>>> scritto:
>>>>
>>>>
>>>> Hi all, I have a upload javascript in my app that call a function in my
>>>> controller to upload files.
>>>>
>>>> It was working fine until now, so I update my web2py to latest version
>>>> and now I get te error:  "not indexable" in my upload function.
>>>>
>>>> Well, my functions is:
>>>>
>>>> def upload_callback():
>>>> if 'qqfile' in request.vars:
>>>> filename = request.vars.qqfile
>>>> newfilename = db.realty_photos.photo.store(r**equest.body,filename
>>>> )
>>>> db.realty_photos.insert(photo=**newfilename,realty_id=request.*
>>>> *args(0))
>>>> return response.json({'success': 'true'})
>>>>
>>>>
>>>> And I sed to it a url like it:
>>>>
>>>> /upload_callback/5?qqfile=1.**png
>>>>
>>>> It works fine in my old version 2.5.1, but not now.
>>>>
>>>> All help is welcome!
>>>>
>>>> Thanks for all.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Error upload file on 2.6.4

2013-09-27 Thread Relsi Hur Maron

Thanks! Now is working. 

It is a production app, no problem to use the current trunk?

Em sexta-feira, 27 de setembro de 2013 11h20min01s UTC-3, Niphlod escreveu:
>
> try current trunk.
>
> Il giorno venerdì 27 settembre 2013 15:17:54 UTC+2, Relsi Hur Maron ha 
> scritto:
>>
>>
>> Hi all, I have a upload javascript in my app that call a function in my 
>> controller to upload files. 
>>
>> It was working fine until now, so I update my web2py to latest version 
>> and now I get te error:  "not indexable" in my upload function.
>>
>> Well, my functions is:
>>
>> def upload_callback():
>> if 'qqfile' in request.vars:
>> filename = request.vars.qqfile
>> newfilename = db.realty_photos.photo.store(request.body, filename
>> )
>> db.realty_photos.insert(photo=newfilename,realty_id=request.args(
>> 0))
>> return response.json({'success': 'true'})
>>
>>
>> And I sed to it a url like it:
>>
>> /upload_callback/5?qqfile=1.png
>>
>> It works fine in my old version 2.5.1, but not now.
>>
>> All help is welcome!
>>
>> Thanks for all.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Error upload file on 2.6.4

2013-09-27 Thread Relsi Hur Maron

Hi all, I have a upload javascript in my app tha call a function in my 
controller to upload files. 

It was working fine until now, so I update my web2py to latest version and 
now I get te error:  "not indexable" in my upload function.

Well, my functions is:

def upload_callback():
if 'qqfile' in request.vars:
filename = request.vars.qqfile
newfilename = db.realty_photos.photo.store(request.body, filename)
db.realty_photos.insert(photo=newfilename,realty_id=request.args(0))
return response.json({'success': 'true'})


And I sed to it a url like it:

/upload_callback/5?qqfile=1.png

It works fine in my old version 2.5.1, but not now.

All help is welcome!

Thanks for all.





















-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Demistifying web2py

2013-08-06 Thread Relsi Hur Maron

Cool, all is better inside the context.

=)


Em terça-feira, 6 de agosto de 2013 09h47min06s UTC-3, Alan Etkin escreveu:
>
> > I think he is making a joke. Nobody says that but some dishonest people 
> form the 
> > competition. 
>
> Yeah, some of the statements I called criticism are very ridiculous 
> and I would like to mention them because they are funny. However I 
> think that users who do not know web2py except for what is said about 
> it can have a very wrong concept about the framework and it could lead 
> them to choose any other sound framewok without even trying web2py 
> first. The proposal aims to warn potential users about unjustified 
> statements but also to give some background on other more serious 
> comparisons. 
>
> Argentina has lots of django mongers, and maybe the most of the 
> criticism comes from them. I also think it is a mistake to use the zen 
> of Python to discard frameworks because of the "... obvious way of 
> doing things ..." wether we are choosing one or another. Tim Peters or 
> whoever created that was not talking about web development frameworks, 
> but about writing Python programs. 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Demistifying web2py

2013-08-05 Thread Relsi Hur Maron

web2py is* just* for learning? why?


Em segunda-feira, 5 de agosto de 2013 16h58min05s UTC-3, Alan Etkin 
escreveu:
>
> I've proposed a talk At PyConAr (Argentina) about all the criticism web2py 
> has had from a technical standpoint. Particularly, I'll try to demonstrate 
> that it is not quite so that:
>
>   web2py *is not Python*
>   web2py *is less performant*
>   web2py *has too much magic*
>   web2py *is just for learning*
>
> The list was made according to my limited experience and maybe it could 
> modified to address more important or serious criticisms
>
> I belive there's a lot of material already available to take care of while 
> collecting references as for example this list's records and maybe 
> stackoverflow and other Pyhon programming resources; I wonder if anybody 
> could help providing other sources or points of view to add to enhance the 
> research.
>
> Please note that this is a simple talk proposal and so far has not been 
> accepted. However, it could be of help for others in case of further work 
> anyway.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Crowdsourcing platform in Web2Py?

2013-07-04 Thread Relsi Hur Maron
What features you need?

I'm developing a project of crowdsourcing here, is commercial but I'll
release a part of the application opensource, with the following features:

- add/listing of jobs
- add/listing workers and portfolios
- signup employee and company
- submission of Proposals
- internal messages

is a very alpha release, but if it fit for you, I can send the app to my
repository on github and you get it.



2013/7/4 D.P. 

> Hello,
>
> it is my first post in this group, and it is a pleasure to be in, as I
> really think that web2py is a great tool.
>
> I am trying to see if there is any opensource crowdsoucing platform made
> in web2py? Does any know any of any code example?
>
> Regards,
>
> D.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: What is the best (or correct) way to show a reference value

2013-06-07 Thread Relsi Hur Maron

Great! Thank you very much guys. =)



Em sexta-feira, 7 de junho de 2013 16h29min55s UTC-3, Anthony escreveu:
>
> {{for data in list:}}
>
> 
>> {{=data.user_name}}
>> {{=("%(name)s" %data.user_city)}}
>> {{=("%(name)s" %data.user_state)}}
>
>
> Above, '%(name)s' % data.user_city results in data.user_city.name being 
> filled into the string. data.user_city is a DAL Reference object -- it 
> stores the ID of the referenced record, but when you do 
> data.user_city.name, it does a recursive 
> selectand 
> retrieves the value in the "name" field of the referenced record. So, 
> the above code will result in two additional db selects for every record in 
> "list". If there are a lot of records, you might want to go with the join 
> method, which just does a single select.
>
> Anthony
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] What is the best (or correct) way to show a reference value

2013-06-07 Thread Relsi Hur Maron
Hi guys, 

I have a doubt here about he best way of show a *reference* value.

I'll use a simple example to illustrate, I have the following tables:


db.define_table('city',
Field('name', type='string')
)
db.define_table('state',
Field('name', type='string')
)
db.define_table('user',
Field('user_name', 'string'),
Field('user_city', 'reference city'),
Field('user_state', 'reference state')
)


When I list the *user* table data in the view, *user_city* and *user_state* 
show their *id's*. It's OK.

So, to display the value of another field, not the Id, I usually do so:

In the controller:


list = db(db.user.id>0).select(
db.user.ALL,
db.state.ALL,
db.state.ALL,
left = [
db.state.on(db.state.id == db.user.user_state),
db.city.on(db.city.id == db.user.user_city)
]
)
return dict(list=list)


And in the view:


{{for data in list:}}

{{=data.user.user_name}}
{{=data.city.name}}
{{=data.state.name}}

{{pass}}

And it works very well, but I discovered here that I can make it in a more 
simple way:

In controller:

list = db(db.user.id >0).select()
return dict(list=list)

In the view:

{{for data in list:}}

{{=data.user_name}}
{{=("%(name)s" %data.user_city)}}
{{=("%(name)s" %data.user_state)}}

{{pass}}

So my question is if I can use this second format, without mounting a join 
as I did in the first example. What is the best (efficient) format? and why?


Thanks to all!!
































-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: PAAS supporting web2py

2013-05-27 Thread Relsi Hur Maron

Pythonanywhere 
https://www.pythonanywhere.com/

Em segunda-feira, 27 de maio de 2013 13h14min39s UTC-3, Arvind Gupta 
escreveu:
>
> Hi
>  Is there any PAAS (like openshift/cloudfoundry) which support web2py?
>
> regards
> Arvind
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: [OFF] App for crowdfundig sites (like KickStarter)

2013-03-25 Thread Relsi Hur Maron
Hi Derek,

Thanks for the feedback, I will fix it in the website, the app is here:
http://chipincode.com/chipincode



2013/3/25 Derek 

> Pretty neat, one issue. Clicking the 'back' button on the scroller causes
> the 'try it' button to bounce off the right side then plop back in the
> proper place. Also, it does not reset the scrolling timer, so if you click
> 'back' before it's going to switch to the next one, it goes back then
> immediately goes to the next item.
>
> Also, the feature item 'Software Livre' isn't translated. Neither is
> 'Documentacao' (I assume that means 'documentation').
>
> On Monday, March 25, 2013 10:48:39 AM UTC-7, Relsi Hur Maron wrote:
>>
>>
>> Hi guys!
>>
>> In recent days we have developed an application to create crowdfunding 
>> platforms
>> (Like KickStarter, IndieGoGo, etc.) with web2py.
>>
>> Our inspiration was another open source application called Catarse,
>> developed in ruby, here in Brazil also.
>>
>> It already has the default functionalities of a system of crowdfunding,
>> integrate with Paypal and MoIP (Brazilian payment gateway), etc.
>>
>> If anyone wants to know, and see in operation:
>>
>> http://chipincode.com
>>
>> Code is here: 
>> https://github.com/**codeupstudio/chipincode<https://github.com/codeupstudio/chipincode>
>>
>> Some Documentation (Brazilian portuguese only. English soon [translators
>> plase!! =P] ):
>> https://github.com/**codeupstudio/chipincode/wiki<https://github.com/codeupstudio/chipincode/wiki>
>>
>> Suggestions, criticisms, contributions, swearing, all are welcome =)
>>
>> Relsi.
>>
>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] [OFF] App for crowdfundig sites (like KickStarter)

2013-03-25 Thread Relsi Hur Maron

Hi guys!

In recent days we have developed an application to create crowdfunding 
platforms 
(Like KickStarter, IndieGoGo, etc.) with web2py.

Our inspiration was another open source application called Catarse, 
developed in ruby, here in Brazil also. 

It already has the default functionalities of a system of crowdfunding, 
integrate with Paypal and MoIP (Brazilian payment gateway), etc.

If anyone wants to know, and see in operation:

http://chipincode.com

Code is here: https://github.com/codeupstudio/chipincode

Some Documentation (Brazilian portuguese only. English soon [translators 
plase!! =P] ): 
https://github.com/codeupstudio/chipincode/wiki

Suggestions, criticisms, contributions, swearing, all are welcome =)

Relsi.



-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Free host for blog with domain?

2013-03-24 Thread Relsi Hur Maron
- OpenShift
- Amazon Web Services (1 year free)


2013/3/24 Mika Sjöman 

> Hi
>
> I wonder if anyone knows where I can put my we2py based blog up where they
> I also can use myOwnDomain.com for free? Not too much traffic, maybe a 100
> a day
>
> And... I just build a community from scratch in two weeks from scratch
> with web2py, coming from django - I must say I LOVE web2py!
>
> Huge thanks!
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: No CMS for Web2Py?

2013-03-23 Thread Relsi Hur Maron

\o/

Cool!!! Forked!!



Em sábado, 23 de março de 2013 16h34min39s UTC-3, Loïc escreveu:
>
> Hi Marcel
>
> For my personal use I developed a basic CMS. The goal was to have 
> something very simple to use.
> Some features need to be improved, but I released the project recently.
> You can have a look at https://github.com/espern/tiny_website
>
> Regards
>
> Le mercredi 13 mars 2013 00:06:09 UTC+1, mjm a écrit :
>>
>> Hi Massimo 
>>
>> auth.wiki seems useful, but mostly for the site developer, not user 
>> friendly enough for site owner/user IMHO. Something like Plone is overkill 
>> for a website. I'd like to see something simple and polished somewhere in 
>> between.
>> I'd be hesitant to use projects like Instant Press and Movuca that seem 
>> (almost) abandoned. I'll have a look at w2cms.
>>
>> Marcel
>>
>>
>> On Tuesday, March 12, 2013 11:18:54 PM UTC+1, Massimo Di Pierro wrote:
>>>
>>> The builit-in wiki despite the misleading name, is kind of a CMS. You 
>>> have pages. Pages have attachements. Pages have 
>>> permissions. Attachments inherit permissions. If you think of a page as a 
>>> folder, this is a CMS lite. ;-)
>>>
>>> There is InstantPress, there is movu.ca and there is w2cms (
>>> https://github.com/mdipierro/w2cms experimental to be revived).
>>>
>>> On Tuesday, 12 March 2013 16:31:23 UTC-5, mjm wrote:

 I really like Web2Py to get things done without much fuss. But I am 
 somewhat surprised there seems to be no CMS for W2P. 

 Projects mentioned in this context on this list Instant Press and 
 Movuca are not very active: Instant Press has seen no releases since 2010. 
 Movuca almost no commits in the last year, the website is gone. A shame 
 really, it seemed quite promising. 
 Auth.wiki is a nice recent addition to W2P but seems geared to 
 developers, not end users. 

 Are there any projects I missed? 

>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] MySQL Error

2013-03-21 Thread Relsi Hur Maron
I have this action that verify is a group exist, if not, it create this 
group:

verify_install = db(db.auth_group.role == 'admin').select()
if not verify_install:
 auth.add_group('admin', 'Administrative Group')
 redirect 
(URL
 
('install',
 'index'))


 works well in sqlite, but in mysql I am getting this error:

IntegrityError: (1452, u'Cannot add or update a child row: a foreign key 
constraint fails (`chipincode`.`auth_event`, CONSTRAINT `auth_event_ibfk_1` 
FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) ON DELETE CASCADE)')


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] [solved] Re: Facebook conect and ExtendedLoginForm()

2013-03-06 Thread Relsi Hur Maron
Hi,

I managed to solve it using the Diego Sorrilha sample 
[1<https://github.com/r4bugento/web2social>]. 
If more anyone to need, gets the reference. =)

[1] https://github.com/r4bugento/web2social



Em terça-feira, 5 de março de 2013 00h17min48s UTC-3, Relsi Hur Maron 
escreveu:
>
> Hi guys!!
>
> Does anyone have an example of connecting to Facebook using the class 
> ExtendedLoginForm?
>
> I try to do it but I receive this error:
>
>   form.components.append(self.alt_login_form.login_form())
>
> AttributeError: 'FaceBookAccount' object has no attribute 'login_form'
>
>
> So, for test, I put a function called login login_form inside the 
> FaceBookAccount, and now I cat this error:
>
> File "/home/relsi/web2py/applications/teste_fb/views/default/user.html", line 
> 85, in 
> AttributeError: 'DIV' object has no attribute 'add_button'
>
>
> if I not use multiple form it work very well, but with auth not!
>
> Anyone have an example working with multiple form?? Or what I need put in 
> login_form()?
>
> I'm using the example that comes *web2py Cookbook eBook*. 
>
> Here my complete model db.py: http://pastebin.com/KxvQVmNk
>
> Thanks for any help!
>
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Facebook conect and ExtendedLoginForm()

2013-03-05 Thread Relsi Hur Maron
Hi guys!!

Does anyone have an example of connecting to Facebook using the class 
ExtendedLoginForm?

I try to do it but I receive this error:

  form.components.append(self.alt_login_form.login_form())

AttributeError: 'FaceBookAccount' object has no attribute 'login_form'


So, for test, I put a function called login login_form inside the 
FaceBookAccount, and now I cat this error:

File "/home/relsi/web2py/applications/teste_fb/views/default/user.html", line 
85, in 
AttributeError: 'DIV' object has no attribute 'add_button'


if I not use multiple form it work very well, but with auth not!

Anyone have an example working with multiple form?? Or what I need put in 
login_form()?

I'm using the example that comes *web2py Cookbook eBook*. 

Here my complete model db.py: http://pastebin.com/KxvQVmNk

Thanks for any help!



-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[SOLVED] Re: [web2py] Re: How to use the "insert" method of python list in web2py

2012-11-29 Thread Relsi Hur

I was so fixed in the string format, that I was ignoring the basic math!
=/

Thanks to everyone for the tips!!

This solve very well:

"%i.%02i" % divmod(348,100)




Em quinta-feira, 29 de novembro de 2012 09h12min39s UTC-2, Joe Barnhart 
escreveu:
>
> Bzzzt!  Thanks for playing!
>
> You get 3.0 for your result.  (I'm not a python genius but I keep an 
> interpreter handy just to type in stuff and see what I get.)
>
>
>   >>> round(int("348")/100,3)
>   3.0
>
>
> In your example, you rounded the result AFTER the integer division of 
> 348/100.  But the result of the integer division was 3, so your rounded 
> version is 3.0.
>
> On Thursday, November 29, 2012 2:02:29 AM UTC-8, Manuele wrote:
>>
>>  Il 29/11/12 10:49, Joe Barnhart ha scritto:
>>  
>> Hmmm... 
>>
>>  That would give "3" since Python 2.x keeps the calculation as integer 
>> (it won't coerce it to a float).
>>
>>  He could do a=int(a)/100.0   But that puts it into a floating point 
>> value, and rounding sometimes gives surprising and unexpected results.
>>
>> my 2 cent...
>>
>> a = round(int(a)/100, 3)
>>
>> M.
>>  
>

-- 





[web2py] How to use the "insert" method of python list in web2py

2012-11-28 Thread Relsi Hur
Hello all!

I need transform a string in a decimal number, I can to do it that way:

>>> a = list("348")
>>> a.insert(-2, '.')
>>> "".join(a)
'3.48'
>>> 

But when try this in web2py I get a "None" value, in the a.insert() 
operation.

So, someone would know how to do this in web2py? This way or otherwise?

-- 





[web2py] Error on OpenShift deploy

2012-10-17 Thread Relsi Hur
Hello, 

I try to deploy a app int the OpenShift using this option in the admin, but 
I have a error. Someone has the inside track for this operation?

The error is:

Traceback (most recent call last):
  File "/home/locatto/Downloads/site-locatto/gluon/restricted.py", line 209, in 
restricted
exec ccode in environment
  File 
"/home/locatto/Downloads/site-locatto/applications/admin/controllers/openshift.py"
 , 
line 58, in 
  File "/home/locatto/Downloads/site-locatto/gluon/globals.py", line 187, in 

self._caller = lambda f: f()
  File 
"/home/locatto/Downloads/site-locatto/applications/admin/controllers/openshift.py"
 , 
line 33, in deploy
index = repo.index
AttributeError: 'Repo' object has no attribute 'index'


-- 





Re: [web2py] Re: Uploadify what am I doing wrong

2012-07-04 Thread Relsi Hur
I had IORERRO when I was using the decorator @auth.requires_login() in my 
function.

Em quarta-feira, 4 de julho de 2012 16h40min45s UTC-3, cheer10s escreveu:
>
> thank you for helping me
>
> I looked at some of the documentation and figured out some things but I 
> get an IORERROafter uploading any ideas
>
> here is my modified controller and my uploadify script I am using 
> uploadify version 3
>
> def myUpload():
> form = SQLFORM(db.music)
> if form.accepts(request.vars,session):
> mySong=request.post_vars.Filedata
> db.music.insert(song = db.music.song.store(mySong.file, 
> mySong.filename))
> response.flash = 'Your info has been submitted'
> return dict(form=form)
> elif form.errors:
> response.flash = 'Please correct the highlighted fields'
> return dict(form=form)
> else:
> return dict(form=form)
>
>
> myUpload.html
>
> 
>
>
> jQuery('document').ready(function() {
> jQuery('#music_song').uploadify({
> 'swf' : '{{=URL("static", "uploadify/uploadify.swf")}}',
> 'script' : '{{=URL("default", "myUpload")}}',
> 'cancelImg' : '{{=URL("static", 
> "uploadify/uploadify-cancel.png")}}',
> 'buttonText': 'Upload Song',
> 'folder' : '/uploads/music',
> 'auto'  : true,
> 'multi' : false,
> 'checkExisting' : false
> });
> });
> 
>
> {{=form}}
>
>
>
>
> On Wed, Jul 4, 2012 at 11:11 AM, Relsi Hur <> wrote:
>
>> here is working fine, but my script is a little different, see if 
>> something helps:
>>
>> <http://pastebin.com/tKLSC9Uw>http://pastebin.com/tKLSC9Uw
>>
>> Em quarta-feira, 4 de julho de 2012 14h05min40s UTC-3, cheer10s escreveu:
>>
>>> Hello I am trying to use uploadify in my web2py app but I am having a 
>>> bit of difficulty no errors occur it just doesn't work
>>>
>>>
>>> These are my controllers
>>>
>>> def index():
>>> return dict() 
>>>
>>> def myUpload():
>>> form = SQLFORM(db.music)
>>> if form.accepts(request.vars, session):
>>> response.flash = 'Your info has been submitted'
>>> return dict(form=form)
>>> elif form.errors:
>>> response.flash = 'Please correct the highlighted fields'
>>> return dict(form=form)
>>> else:
>>> return dict(form=form)
>>>
>>>
>>> my index view
>>>
>>> {{extend "template.html"}}
>>> 
>>>
>>> {{=LOAD('default','myUpload',**ajax=False)}}
>>>
>>> 
>>>
>>> myUpload view (its not a load file)
>>>
>>> 
>>> $(document).ready(function() {
>>>   $('#music_song').uploadify({
>>> "uploader"  : "{{=URL('static', 'uploadify/uploadify.swf')}}",
>>> "script": "{{=URL('default', 'index')}}",
>>> "cancelImg" : "{{=URL('static', 'uploadify/uploadify-cancel.**
>>> png')}}",
>>> "auto"  : true
>>>   });
>>> });
>>> 
>>>
>>> {{=form}}
>>>
>>>
>>>
>>> and this is in template.html 
>>>
>>>
>>> >> type="text/css" rel="stylesheet" />
>>>
>>> {{include "web2py_ajax.html"}}
>>>
>>> <**/script>
>>> <script type="text/javascript" src="{{=URL('static', 
>>> 'uploadify/jquery.uploadify-3.**1.min.js')}}">
>>>
>>>
>>> the button appears but doesn't do anything can't select uploads 
>>>
>>> Any ideas?
>>>
>>> *cheers
>>>
>>>
>>>
>

[web2py] Re: Uploadify what am I doing wrong

2012-07-04 Thread Relsi Hur
here is working fine, but my script is a little different, see if something 
helps:

http://pastebin.com/tKLSC9Uw

Em quarta-feira, 4 de julho de 2012 14h05min40s UTC-3, cheer10s escreveu:
>
> Hello I am trying to use uploadify in my web2py app but I am having a bit 
> of difficulty no errors occur it just doesn't work
>
>
> These are my controllers
>
> def index():
> return dict() 
>
> def myUpload():
> form = SQLFORM(db.music)
> if form.accepts(request.vars, session):
> response.flash = 'Your info has been submitted'
> return dict(form=form)
> elif form.errors:
> response.flash = 'Please correct the highlighted fields'
> return dict(form=form)
> else:
> return dict(form=form)
>
>
> my index view
>
> {{extend "template.html"}}
> 
>
> {{=LOAD('default','myUpload',ajax=False)}}
>
> 
>
> myUpload view (its not a load file)
>
> 
> $(document).ready(function() {
>   $('#music_song').uploadify({
> "uploader"  : "{{=URL('static', 'uploadify/uploadify.swf')}}",
> "script": "{{=URL('default', 'index')}}",
> "cancelImg" : "{{=URL('static', 'uploadify/uploadify-cancel.png')}}",
> "auto"  : true
>   });
> });
> 
>
> {{=form}}
>
>
>
> and this is in template.html 
>
>
>  rel="stylesheet" />
>
> {{include "web2py_ajax.html"}}
>
> 
> 
>
>
> the button appears but doesn't do anything can't select uploads 
>
> Any ideas?
>
> *cheers
>
>
>

[web2py] [Solved] Re: update() is creating a new item

2012-06-08 Thread Relsi Hur


Em sexta-feira, 8 de junho de 2012 12h32min12s UTC-3, Anthony escreveu:
>
> By default, form.process() does an insert of the submitted record. If you 
> don't want that, you can do:
>
> if form.process(..., dbio=False).accepted:
>
> or
>
> if form.validate(...):
>
> The only difference between process() and validate() is that dbio=True by 
> default in process(), and process() returns the form itself rather than the 
> True/False result of the validation.
>


*Thank you so much for the solution, Anthony.*

 

>
> Is there a reason you're not using an update form, though?
>
*
Yes, because the html is already ready, and have other people involved in 
the project. So we're not using {{=form}}. ;)*

 

>
> Anthony
>
> On Friday, June 8, 2012 11:18:50 AM UTC-4, Relsi Hur wrote:
>>
>> Hello,
>>
>> I have a html form, and a action like this:
>>
>> def edit_my_table():
>> form = SQLFORM(db.my_table)
>> if form.process(session=None, formname='edit_').accepted:
>> db(db.my_table.id == request.args[0]).update(my_field = 
>> request.post_vars.my_value)
>> response.flash = 'OK'
>> elif form.errors:
>> response.flash = 'NOK'
>>
>> Well, it is updating 'my_field' in 'my_db' correctly, but it is creating 
>> a new item too, with the same value of the update.
>>
>> Database is sqlite.
>>
>> What am I doing wrong?
>>
>>
>>

[web2py] update() is creating a new item

2012-06-08 Thread Relsi Hur
Hello,

I have a html form, and a action like this:

def edit_my_table():
form = SQLFORM(db.my_table)
if form.process(session=None, formname='edit_').accepted:
db(db.my_table.id == request.args[0]).update(my_field = 
request.post_vars.my_value)
response.flash = 'OK'
elif form.errors:
response.flash = 'NOK'

Well, it is updating 'my_field' in 'my_db' correctly, but it is creating a 
new item too, with the same value of the update.

Database is sqlite.

What am I doing wrong?




[web2py] Re: improvement proposal

2011-12-14 Thread Relsi Hur
cool!

On 14 dez, 16:55, Massimo Di Pierro 
wrote:
> How about we ship routes.examples.py with this code in it?
>
> routes_onerror = [
>     ('*/400','http://httpcats.herokuapp.com/401'),
>     ('*/401','http://httpcats.herokuapp.com/401'),
>     ('*/403','http://httpcats.herokuapp.com/403'),
>     ('*/404','http://httpcats.herokuapp.com/404'),
>     ('*/405','http://httpcats.herokuapp.com/405'),
>     ('*/406','http://httpcats.herokuapp.com/406'),
>     ('*/407','http://httpcats.herokuapp.com/407'),
>     ('*/408','http://httpcats.herokuapp.com/408'),
>     ('*/501','http://httpcats.herokuapp.com/501'),
> ]


[web2py] Re: free web2py host?

2011-08-19 Thread Relsi Hur
Hi Massimo, I deploy an application by following the documentation
this way:

1 - send web2py for the root, and create a diretory caled /public in
the root too

2 - create a file called web2py.fcgi, in /public dir, with this
content

#!/usr/bin/python

import os, sys
_PROJECT_DIR =
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, _PROJECT_DIR)
os.chdir(_PROJECT_DIR)

import gluon.main
import gluon.contrib.gateways.fcgi as fcgi
fcgi.WSGIServer(gluon.main.wsgibase, environ={'web2py_path':
_PROJECT_DIR}).run()


3 - set permission to run the file: chmod +x web2py.fcgi

4 - create a file .htaccess in /public with this content:

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ web2py.fcgi/$1 [QSA,L]

5 - Now, go into your admin panel, in the left side menu, click on
Domains. On the screen that opens, you will see the path to the root
of your application, click Edit and change the path to your directory /
public. If you sent the files to the root, the configuration should
look like this: /www/public/

it is (http://tuxtilt.alwaysdata.net/)





On 19 ago, 14:13, Massimo Di Pierro 
wrote:
> I found a free web2py hosting service: alwaysdata.com
>
> They only provide 10MB free but if you remove applications/examples
> and gluon/contrib/populate.py and gluon/contrib/py*/* web2py fits in
> there.
>
> Problem. They support fcgi but I cannot figure it out. Instructions
> are scarse and in french.
>
> Can anybody else?
>
> massimo


[web2py] Re: Authentication for services in iPhone not work

2011-08-10 Thread Relsi Hur
Hi Clifford,
I'm not the iPhone developer. I created the service in web2py and
someone else is trying to consume the service via iPhone. I know
nothing of the iPhone environment (and not have one too), and also did
not find any reference material to verify the authentication method
actually used in web2py does not work with iPhone, I'm guided only by
the iPhone developer said, that the way I implemented it can not
authenticate. Your idea is good, but the project is to provide a
service only.

On Aug 10, 7:07 pm, "G. Clifford Williams" 
wrote:
> Relsi, do you know whether he's developing using Obj-C or a framework like
> (Titanium, Corona, LiveCode, etc...)?
>
> I ask because he could use a webview to usher content back and forth from
> the network calls to the main meat of his application. This is pretty
> trivial with Obj-C, Corona (Lua), and Titanium (JavaScript) but incurs the
> expense of loading a full HTML+CSS+JS parsing engine and then loading
> objects. The key benefit is that it preserves session (from the client
> perspective) just like a desktop browser. Making successive calls would all
> be part of one 'session' provided there hasn't been a time out. Timeouts can
> be trapped and you could use a call back to log the user back in.
>
> It's just one way to solve that problem.
>
> On Wed, Aug 10, 2011 at 4:48 PM, Massimo Di Pierro <
>
>
>
>
>
>
>
> massimo.dipie...@gmail.com> wrote:
> > Look at the source of the decorator in gluon/tools.py. It should be
> > trivial to change it and take the username:password from a
> > request.vars or from a request.env
>
> > On Aug 10, 4:35 pm, Relsi Hur  wrote:
> > > Anyone else? =)
>
> > > any tips on how to pass the username and password as parameters of the
> > > method and continue using the decorator?
>
> > > On Aug 10, 3:56 am, Relsi Hur  wrote:
>
> > > > Yes, the objective-C suport xml-rpc, but the developer says that
> > theiphonedoes not work the wire formathttps://username:password@my_server
> > /my_app/service/call/xmlrpc.
> > > > I do not work with the platform iOS, so I do not know the
> > > > particularities of the platform, I do not want is having to stop using
> > > > the web2py decorators only to have to answer a specific platform. If
> > > > someone has already developediPhonecan give a hint about it, I thank
> > > > you very much.
>
> > > > On Aug 10, 3:34 am, Christopher Steel  wrote:
>
> > > > > I have not tried xml-rpc on theiphonebut apparently Wordpress has
> > some
> > > > >iphonexmlrpc examples...
>
> > > > >http://stackoverflow.com/questions/147062/does-iphone-support-xml-rpc
>
> > > > > Let us know how it goes!
>
> > > > > C.


[web2py] Re: Authentication for services in iPhone not work

2011-08-10 Thread Relsi Hur
Hi Massimo, then it would be appropriate to implement this in my
method, not change the core web2py...

On Aug 10, 6:48 pm, Massimo Di Pierro 
wrote:
> Look at the source of the decorator in gluon/tools.py. It should be
> trivial to change it and take the username:password from a
> request.vars or from a request.env
>
> On Aug 10, 4:35 pm, Relsi Hur  wrote:
>
>
>
>
>
>
>
> > Anyone else? =)
>
> > any tips on how to pass the username and password as parameters of the
> > method and continue using the decorator?
>
> > On Aug 10, 3:56 am, Relsi Hur  wrote:
>
> > > Yes, the objective-C suport xml-rpc, but the developer says that 
> > > theiphonedoes not work the wire 
> > > formathttps://username:password@my_server/my_app/service/call/xmlrpc.
> > > I do not work with the platform iOS, so I do not know the
> > > particularities of the platform, I do not want is having to stop using
> > > the web2py decorators only to have to answer a specific platform. If
> > > someone has already developediPhonecan give a hint about it, I thank
> > > you very much.
>
> > > On Aug 10, 3:34 am, Christopher Steel  wrote:
>
> > > > I have not tried xml-rpc on theiphonebut apparently Wordpress has some
> > > >iphonexmlrpc examples...
>
> > > >http://stackoverflow.com/questions/147062/does-iphone-support-xml-rpc
>
> > > > Let us know how it goes!
>
> > > > C.


[web2py] Re: Authentication for services in iPhone not work

2011-08-10 Thread Relsi Hur
Anyone else? =)

any tips on how to pass the username and password as parameters of the
method and continue using the decorator?

On Aug 10, 3:56 am, Relsi Hur  wrote:
> Yes, the objective-C suport xml-rpc, but the developer says that 
> theiphonedoes not work the wire 
> formathttps://username:password@my_server/my_app/service/call/xmlrpc.
> I do not work with the platform iOS, so I do not know the
> particularities of the platform, I do not want is having to stop using
> the web2py decorators only to have to answer a specific platform. If
> someone has already developediPhonecan give a hint about it, I thank
> you very much.
>
> On Aug 10, 3:34 am, Christopher Steel  wrote:
>
>
>
>
>
>
>
> > I have not tried xml-rpc on theiphonebut apparently Wordpress has some
> >iphonexmlrpc examples...
>
> >http://stackoverflow.com/questions/147062/does-iphone-support-xml-rpc
>
> > Let us know how it goes!
>
> > C.


[web2py] Re: Authentication for services in iPhone not work

2011-08-09 Thread Relsi Hur
Yes, the objective-C suport xml-rpc, but the developer says that the
iphone does not work the wire format 
https://username:password@my_server/my_app/service/call/xmlrpc.
I do not work with the platform iOS, so I do not know the
particularities of the platform, I do not want is having to stop using
the web2py decorators only to have to answer a specific platform. If
someone has already developed iPhone can give a hint about it, I thank
you very much.

On Aug 10, 3:34 am, Christopher Steel  wrote:
> I have not tried xml-rpc on the iphone but apparently Wordpress has some
> iphone xmlrpc examples...
>
> http://stackoverflow.com/questions/147062/does-iphone-support-xml-rpc
>
> Let us know how it goes!
>
> C.


[web2py] Authentication for services in iPhone not work

2011-08-08 Thread Relsi Hur
Hello,

I have a simple function, like this:

@service.xmlrpc
def list_car():
cars=db(db.car.id_person==auth.user.id).select(db.car.id,
db.car.color)
return cars.response

Well, I'm accessing the service so: 
https://username:password@my_server/my_app/service/call/xmlrpc

This works fine on my computer (python), but the person who is saying
that developing for iPhone gives "time out" error, he said the problem
is to pass the login and password via url, not work in iPhone. Someone
here on the list developed for iPhone that could tell if what he says
is correct?




[web2py] A simple app with Google Maps API

2011-06-07 Thread Relsi Hur
Hello guys,

Last year I made ​​a small application to start my studies in web2py,
with the help of Massimo I did deploy in the Google App Engine [1].

Now I realize that not released the code, then, for those who want to
use for their studies, or implement in any app, the code is available
on github now [2].

Is a very simple example of the Google Maps Api use, still have to
apply some changes suggested and create other features.

Pull Requests are welcome. :)

[1] http://web2pyople.appspot.com/
[2] http://github.com/relsi/web2pyople


[web2py] Re: DjangoPeople Clone

2010-10-06 Thread Relsi Hur
Thanks for all feedback.
I fix the point marks bug (not definite yet), and I will fix the
others bugs and apply the suggestions. This weekend I'll improve the
code and put in a public repository for everyone in the community have
access, and for those who want to collaborate with the code.

I noticed that the marking system of coordinates must be improved
immediately, and try to fix it first. More suggestions are welcome.


> there are another project like 
> that:http://www.appenginepeople.net/users/tag/web2py

>
> 2010/10/6 Relsi Hur 
>
>
>
> > Great suggestions, I'll make changes.
>
> > I initially thought of using only the location of the city and
> > country, but I need the geographic location of a street or a building
> > to another project and no need the coutry or city, so I used this
> > application as a laboratory. ;)
>
> > But I can change in this, In djangopeople they use the geonames API
> > for populate a select list (no database), in we2pyople I make a model
> > and insert all countries, but I would like to use geonames API to
> > generate the select fields values. I call the forms of auth just:
> > {{=form}}, then the next step for me is to learn how customize the
> > form fields to be generated values dynamically of a JSON or XML
> > document.
>
> > On 6 out, 15:16, mdipierro  wrote:
> > > This is nice and useful. Some suggestions:
>
> > > 1) to the auth_user table add:
>
> > Field('city'),Field('country'),Field('bio'),Field('completed_registration','boolean',default=False)
>
> > > 2) make compleed_registration, latitude and longitude writable=False
>
> > > 3) use rpx for login
>
> > > 4) add this
>
> > > if auth.user and not auth.user.completed_registration:
> > >    redirect(URL('default','user/profile')
> > > def compute_lola(form):
> > >     from gluon.tools import geocode
> > >     form.vars.completed_registration=True
> > >     form.vars.longitude, form.vars.latitude = geocode("%s %s" %
> > > (form.vars.city, form.vars.country))
> > > auth.settings.register_onvalidation=compute_lola
> > > auth.settings.profile_onvalidation=compute_lola
>
> > > This will automate the computation of latitude and longitude + you
> > > will not have to send emails to verify credentials.
>
> > > Massimo
>
> > > On Oct 6, 1:07 pm, Relsi Hur  wrote:
>
> > > > Hi, a make a very very simple clone ofhttp://www.djangopeople.net,
> > > > just to practice the development of applications with web2py.
>
> > > > For now, has only the registration and location on the map, later I
> > > > will implement the listings of users by country, and others things.
>
> > > > see:http://web2pyople.appspot.com
>
> > > > any suggestion, complaint or criticism is welcome =)
>
> > > > Once again want to thank Massimo for all help.
>
> --
>
> http://rochacbruno.com.br


[web2py] Re: DjangoPeople Clone

2010-10-06 Thread Relsi Hur
Great suggestions, I'll make changes.

I initially thought of using only the location of the city and
country, but I need the geographic location of a street or a building
to another project and no need the coutry or city, so I used this
application as a laboratory. ;)

But I can change in this, In djangopeople they use the geonames API
for populate a select list (no database), in we2pyople I make a model
and insert all countries, but I would like to use geonames API to
generate the select fields values. I call the forms of auth just:
{{=form}}, then the next step for me is to learn how customize the
form fields to be generated values dynamically of a JSON or XML
document.


On 6 out, 15:16, mdipierro  wrote:
> This is nice and useful. Some suggestions:
>
> 1) to the auth_user table add:
>
> Field('city'),Field('country'),Field('bio'),Field('completed_registration','boolean',default=False)
>
> 2) make compleed_registration, latitude and longitude writable=False
>
> 3) use rpx for login
>
> 4) add this
>
> if auth.user and not auth.user.completed_registration:
>    redirect(URL('default','user/profile')
> def compute_lola(form):
>     from gluon.tools import geocode
>     form.vars.completed_registration=True
>     form.vars.longitude, form.vars.latitude = geocode("%s %s" %
> (form.vars.city, form.vars.country))
> auth.settings.register_onvalidation=compute_lola
> auth.settings.profile_onvalidation=compute_lola
>
> This will automate the computation of latitude and longitude + you
> will not have to send emails to verify credentials.
>
> Massimo
>
> On Oct 6, 1:07 pm, Relsi Hur  wrote:
>
> > Hi, a make a very very simple clone ofhttp://www.djangopeople.net,
> > just to practice the development of applications with web2py.
>
> > For now, has only the registration and location on the map, later I
> > will implement the listings of users by country, and others things.
>
> > see:http://web2pyople.appspot.com
>
> > any suggestion, complaint or criticism is welcome =)
>
> > Once again want to thank Massimo for all help.
>
>


[web2py] DjangoPeople Clone

2010-10-06 Thread Relsi Hur
Hi, a make a very very simple clone of http://www.djangopeople.net,
just to practice the development of applications with web2py.

For now, has only the registration and location on the map, later I
will implement the listings of users by country, and others things.

see: http://web2pyople.appspot.com

any suggestion, complaint or criticism is welcome =)

Once again want to thank Massimo for all help.


[web2py] Re: XML on GAE [Resolved]

2010-10-06 Thread Relsi Hur
Thank you very much Massimo, now this returns only the selected
fields.

=)

On 6 out, 14:09, mdipierro  wrote:
> You cannot export binary data (from blob) in xml. The problem is that
> GAE ignores your list of fields. Instead you can do
>
> #xml tags
> def export_xml(rows,fields):
>     users=[]
>     for row in rows: users.append(TAG.user(*[TAG[f](row[f]) for f in
> fields]))
>     return TAG.users(*users).xml()
>
> #xml view
> def lista():
>     response.headers['Content-Type']='application/xml'
>     return export_xml(db(db.auth_user.id>0).select(),
>         ['bio','lat','lgt','first_name','country'])
>
> On Oct 6, 11:59 am, Relsi Hur  wrote:
>
> > well, in this way:
>
> > db(db.auth_user.id>0).select(db.auth_user.bio, db.auth_user.lat,
> > db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country)
>
> > Returns all fields of database, and not my selected, look:
> > 
> >     
> >         46005
> >         Relsi
> >         Hur Maron
> >         patosav...@gmail.com
> >         87c709cdd4fe74117b8a9baf74f1ebc7 > auth_user.password>
> >         
> >         
> >         
> >         
> >         blablabla
> >         Brazil
> >         
> >         -32.7687993988
> >         -51.0204953125
> >         None
> >     
> > 
>
> > but if I have a image in any record, the XML is not generated, the
> > structure is broken in the element , here no
> > close the tag, just input this: \u\ufffd\ufffd\ufffd, and GAE
> > returns a XML structure error.
>
> > I not need all fields in XML, only those of my select, then I think
> > that if he can return only the fields that I need the problem is
> > solved, but the GAE execut my action in this way
> > db(db.auth_user.id>0).select(db.auth_user.ALL), and not in this way
> > db(db.auth_user.id>0).select(db.auth_user.bio, db.auth_user.lat,
> > db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country).
>
> > On 6 out, 13:19, mdipierro  wrote:
>
> > > I do not understand.
>
> > > On Oct 6, 9:37 am, Relsi Hur  wrote:
>
> > > > Thank you very much Massimo,
>
> > > > Now returns alls fiels of model, but not complete structure, have
> > > > error in image element:
>
> > > > here: \u\ufffd\ufffd\ufffd
>
> > > > is not closing the tag, if have a image in db.
>
> > > > On 6 out, 10:42, mdipierro  wrote:
>
> > > > > Try replace
>
> > > > > db().select(db.auth_user.bio, db.auth_user.lat,
> > > > > db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country)
>
> > > > > with
>
> > > > > db(db.auth_user.id>0).select(db.auth_user.bio, db.auth_user.lat,
> > > > > db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country)
>
> > > > > On Oct 6, 2:23 am, Relsi Hur  wrote:
>
> > > > > > Hello, I'm learning to use web2py and created a small application 
> > > > > > and
> > > > > > deploy on GAE, in this app I have a action that return a xml:
>
> > > > > > #xml tags
> > > > > > def export_xml(rows):
> > > > > >     idx=range(len(rows.colnames))
> > > > > >     colnames=[item.replace('users.','') for item in rows.colnames]
> > > > > >     users=[]
> > > > > >     for row in rows.response: users.append(TAG['user']
> > > > > > (*[TAG[colnames[i]](row[i]) for i in idx]))
> > > > > >     return str(TAG['users'](*users))
>
> > > > > > #xml view
> > > > > > def lista():
> > > > > >     response.headers['Content-Type']='application/xml'
> > > > > >     return export_xml(db().select(db.auth_user.bio, 
> > > > > > db.auth_user.lat,
> > > > > > db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country))
>
> > > > > > in localhost, this returns:
>
> > > > > > 
> > > > > >     
> > > > > >         User bio
> > > > > >         -31.0717547966
> > > > > >         -51.3720578125
> > > > > >         Relsi
> > > > > >         Brazil
> > > > > >     
> > > > > > 
>
> > > > > > but In GAE returns error:
>
>

[web2py] Re: XML on GAE

2010-10-06 Thread Relsi Hur
well, in this way:

db(db.auth_user.id>0).select(db.auth_user.bio, db.auth_user.lat,
db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country)

Returns all fields of database, and not my selected, look:


46005
    Relsi
    Hur Maron
patosav...@gmail.com
87c709cdd4fe74117b8a9baf74f1ebc7




blablabla
Brazil

-32.7687993988
-51.0204953125
None



but if I have a image in any record, the XML is not generated, the
structure is broken in the element , here no
close the tag, just input this: \u\ufffd\ufffd\ufffd, and GAE
returns a XML structure error.

I not need all fields in XML, only those of my select, then I think
that if he can return only the fields that I need the problem is
solved, but the GAE execut my action in this way
db(db.auth_user.id>0).select(db.auth_user.ALL), and not in this way
db(db.auth_user.id>0).select(db.auth_user.bio, db.auth_user.lat,
db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country).





On 6 out, 13:19, mdipierro  wrote:
> I do not understand.
>
> On Oct 6, 9:37 am, Relsi Hur  wrote:
>
> > Thank you very much Massimo,
>
> > Now returns alls fiels of model, but not complete structure, have
> > error in image element:
>
> > here: \u\ufffd\ufffd\ufffd
>
> > is not closing the tag, if have a image in db.
>
> > On 6 out, 10:42, mdipierro  wrote:
>
> > > Try replace
>
> > > db().select(db.auth_user.bio, db.auth_user.lat,
> > > db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country)
>
> > > with
>
> > > db(db.auth_user.id>0).select(db.auth_user.bio, db.auth_user.lat,
> > > db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country)
>
> > > On Oct 6, 2:23 am, Relsi Hur  wrote:
>
> > > > Hello, I'm learning to use web2py and created a small application and
> > > > deploy on GAE, in this app I have a action that return a xml:
>
> > > > #xml tags
> > > > def export_xml(rows):
> > > >     idx=range(len(rows.colnames))
> > > >     colnames=[item.replace('users.','') for item in rows.colnames]
> > > >     users=[]
> > > >     for row in rows.response: users.append(TAG['user']
> > > > (*[TAG[colnames[i]](row[i]) for i in idx]))
> > > >     return str(TAG['users'](*users))
>
> > > > #xml view
> > > > def lista():
> > > >     response.headers['Content-Type']='application/xml'
> > > >     return export_xml(db().select(db.auth_user.bio, db.auth_user.lat,
> > > > db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country))
>
> > > > in localhost, this returns:
>
> > > > 
> > > >     
> > > >         User bio
> > > >         -31.0717547966
> > > >         -51.3720578125
> > > >         Relsi
> > > >         Brazil
> > > >     
> > > > 
>
> > > > but In GAE returns error:
>
> > > > In FILE: /base/data/home/apps/web2pyople/1.345301654218685961/
> > > > applications/init/controllers/default.py
>
> > > > Traceback (most recent call last):
> > > >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > > > restricted.py", line 178, in restricted
> > > >     exec ccode in environment
> > > >   File "/base/data/home/apps/web2pyople/1.345301654218685961/
> > > > applications/init/controllers/default.py:lista", line 45, in 
> > > >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > > > globals.py", line 96, in 
> > > >     self._caller = lambda f: f()
> > > >   File "/base/data/home/apps/web2pyople/1.345301654218685961/
> > > > applications/init/controllers/default.py:lista", line 43, in lista
> > > >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > > > contrib/gql.py", line 678, in select
> > > >     (items, tablename, fields) = self._select(*fields, **attributes)
> > > >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > > > contrib/gql.py", line 630, in _select
> > > >     table = self._get_table_or_raise()
> > > >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > > > contrib/gql.py", line 609, in _get_table_or_raise
> > > >     raise SyntaxError, 'Set: no tables selected'
> > > > SyntaxError: Set: no tables selected
>
> > > > what am I doing wrong?
>
>


[web2py] Re: XML on GAE

2010-10-06 Thread Relsi Hur
Thank you very much Massimo,

Now returns alls fiels of model, but not complete structure, have
error in image element:

here: \u\ufffd\ufffd\ufffd

is not closing the tag, if have a image in db.



On 6 out, 10:42, mdipierro  wrote:
> Try replace
>
> db().select(db.auth_user.bio, db.auth_user.lat,
> db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country)
>
> with
>
> db(db.auth_user.id>0).select(db.auth_user.bio, db.auth_user.lat,
> db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country)
>
> On Oct 6, 2:23 am, Relsi Hur  wrote:
>
> > Hello, I'm learning to use web2py and created a small application and
> > deploy on GAE, in this app I have a action that return a xml:
>
> > #xml tags
> > def export_xml(rows):
> >     idx=range(len(rows.colnames))
> >     colnames=[item.replace('users.','') for item in rows.colnames]
> >     users=[]
> >     for row in rows.response: users.append(TAG['user']
> > (*[TAG[colnames[i]](row[i]) for i in idx]))
> >     return str(TAG['users'](*users))
>
> > #xml view
> > def lista():
> >     response.headers['Content-Type']='application/xml'
> >     return export_xml(db().select(db.auth_user.bio, db.auth_user.lat,
> > db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country))
>
> > in localhost, this returns:
>
> > 
> >     
> >         User bio
> >         -31.0717547966
> >         -51.3720578125
> >         Relsi
> >         Brazil
> >     
> > 
>
> > but In GAE returns error:
>
> > In FILE: /base/data/home/apps/web2pyople/1.345301654218685961/
> > applications/init/controllers/default.py
>
> > Traceback (most recent call last):
> >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > restricted.py", line 178, in restricted
> >     exec ccode in environment
> >   File "/base/data/home/apps/web2pyople/1.345301654218685961/
> > applications/init/controllers/default.py:lista", line 45, in 
> >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > globals.py", line 96, in 
> >     self._caller = lambda f: f()
> >   File "/base/data/home/apps/web2pyople/1.345301654218685961/
> > applications/init/controllers/default.py:lista", line 43, in lista
> >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > contrib/gql.py", line 678, in select
> >     (items, tablename, fields) = self._select(*fields, **attributes)
> >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > contrib/gql.py", line 630, in _select
> >     table = self._get_table_or_raise()
> >   File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
> > contrib/gql.py", line 609, in _get_table_or_raise
> >     raise SyntaxError, 'Set: no tables selected'
> > SyntaxError: Set: no tables selected
>
> > what am I doing wrong?
>
>


[web2py] XML on GAE

2010-10-06 Thread Relsi Hur
Hello, I'm learning to use web2py and created a small application and
deploy on GAE, in this app I have a action that return a xml:

#xml tags
def export_xml(rows):
idx=range(len(rows.colnames))
colnames=[item.replace('users.','') for item in rows.colnames]
users=[]
for row in rows.response: users.append(TAG['user']
(*[TAG[colnames[i]](row[i]) for i in idx]))
return str(TAG['users'](*users))

#xml view
def lista():
response.headers['Content-Type']='application/xml'
return export_xml(db().select(db.auth_user.bio, db.auth_user.lat,
db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country))

in localhost, this returns:



User bio
-31.0717547966
-51.3720578125
Relsi
Brazil



but In GAE returns error:

In FILE: /base/data/home/apps/web2pyople/1.345301654218685961/
applications/init/controllers/default.py

Traceback (most recent call last):
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
restricted.py", line 178, in restricted
exec ccode in environment
  File "/base/data/home/apps/web2pyople/1.345301654218685961/
applications/init/controllers/default.py:lista", line 45, in 
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
globals.py", line 96, in 
self._caller = lambda f: f()
  File "/base/data/home/apps/web2pyople/1.345301654218685961/
applications/init/controllers/default.py:lista", line 43, in lista
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
contrib/gql.py", line 678, in select
(items, tablename, fields) = self._select(*fields, **attributes)
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
contrib/gql.py", line 630, in _select
table = self._get_table_or_raise()
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
contrib/gql.py", line 609, in _get_table_or_raise
raise SyntaxError, 'Set: no tables selected'
SyntaxError: Set: no tables selected

what am I doing wrong?


[web2py] Re: web2py_vs_others missing T() section!

2010-09-09 Thread Relsi Hur
Hi Massimo,

I have here an editable version of the document which I will translate
to Portuguese soon, if you want to catch:

https://docs.google.com/document/edit?id=14jfi7HUf-F41N6HHvqx87S3GTHQNku_q75RdySsoib8&hl=pt_BR&authkey=CJafieIG

Relsi
http://www.tuxtilt.com

On 8 set, 23:13, mdipierro  wrote:
> thanks. can you take charge and post it on a google doc? I can help
> editing.
>
> On Sep 8, 9:08 pm, weheh  wrote:
>
> > Here's the text of the pdf document, courtesy one of my websites,
> > YAKiToMe!http://www.yakitome.com.
>
> > ---
>
> > web frameworks design comparison
> > draft - please help me improve it focus on Model-View-Controller
> > frameworks
>
> > Controllers
> > In Rails class MyTestController < ApplicationController def index
> > render_text "Hello World" end end
>
> > The name of the class has to match the name of the controller file.
>
> > Controllers
> > In Django from django.http import HttpResponse def index(request):
> > return HttpResponse("Hello World")
>
> > Django is explicit, you need to import all functions you use.
>
> > Controllers
> > In Cherrypy and TurboGears 1.0 import cherrypy class MyRoot:
> > @cherrypy.expose() def index(self): return "Hello World"
>
> > Cherrypy, Turbogears, and Pylons are also explicit. You need to import
> > all functions you want to use.
>
> > Controllers
> > In web2py def index(): return "Hello World"
>
> > web2py is similar to Rails. It imports for you all the web2py keyword.
> > Often, like in this case, you do not need any.
>
> > Get/Post requests
> > In Rails class MyTestController < ApplicationController def index
> > render_text "Hello "+params[:who] end end
>
> > GET and POST variables are passed via params but other request
> > parameters (client ip for example) are passed via a different
> > mechanism.
>
> > Get/Post requests
> > In Django from django.http import HttpResponse def index(request):
> > return HttpResponse("Hello World %s" % request.REQUEST[`who’])
>
> > Nice, simple. The request contains all the info. You can use .GET
> > or .POST instead of .REQUEST to be more specific.
>
> > Get/Post requests
> > In Cherrypy and TurboGears 1.0 import cherrypy class MyRoot:
> > @cherrypy.expose() def index(self,who): return "Hello %s" % who
>
> > GET and POST variables are passed via arguments of the action, but
> > other request parameters (client ip for example) are passed via a
> > different mechanism.
>
> > Get/Post requests
> > In web2py def index(): return "Hello %s" % request.vars.who
>
> > Similar to Django. All request data is in one place. You can
> > use .get_vars and .post_vars instead of .vars to be more specific.
>
> > Dispatching
> > In Rails URLhttp://hostname/MyTest/indexgetsmapped into class
> > MyTestController < ApplicationController def index render_text "Hello
> > World" end end
>
> > By default Rails does not allow running multiple apps without running
> > multiple copies of Rails, since the name of the app is not in the URL,
> > only the controller name (MyTest) and the action name (index) appear.
> > This can be changed by configuring routes.
>
> > Dispatching
> > In Django you need to edit url.py to map URLs into actions from
> > django.conf.urls.defaults import * urlpatterns = patterns(’’, (r’^index
> > $’, myapp.mycontroller.index), )
>
> > This is the equivalent of Rails’ routes and it requires using regular
> > expressions. There is no default. You need one entry in url.py for
> > every action.
>
> > Dispatching
> > In Cherrypy and TurboGears 1.0 import cherrypy class MyRoot:
> > @cherrypy.expose() def index(self,who): return "Hello %s" % who
>
> > Works very much like Rails and default mapping between URL and action
> > can be overwritten.
>
> > Dispatching
> > In web2py a URL likehttp://hostname/myapp/mycontroller/indexcalls
> > def index(): return "Hello %s" % request.vars.who
>
> > Similar to Rails and Charrypy but, by default the URL requires that
> > you specify the name of the app. This allows web2py to run multiple
> > apps without using routes. Web2py has its own version of routes that
> > supports two different syntaxes (with and without regular expression)
> > to overwrite the mapping and reverse mapping as well.
>
> > Calling Views
> > In Rails class MyTestController < ApplicationController def index
> > @message="Hello World" end end
>
> > It calls the default view (MyTest/index) which renders the page. The
> > variables marked by @ are global vars and are passed to the view.
> > Notice that if the view is not defined, this results in an error
> > message.
>
> > Calling Views
> > In Django from django.shortcuts import render_to_response def
> > index(request): return render_to_response("index.html",
> > {`message’:’Hello World’})
>
> > This is the short way of doing it in Django. You have to specify the
> > view name "index.html" since there is no default. Parameters are
> > passed via a dictionary. You get an error message if the view is not
> > defined. Notice that in Dja