[web2py] Re: JQuery Help with book example of .slideToggle

2016-03-23 Thread xmarx
you have to specify that with css.

add this:


.two {
display:none;
}




22 Mart 2016 Salı 21:22:14 UTC+2 tarihinde billmac...@gmail.com yazdı:
>
> In the book example page 501
>
> Hello
> World
> 
> jQuery(document).ready(function(){
> jQuery('.one').click(function(){jQuery('.two').slideToggle()});
> });
> 
>
>
> When the page loads up it shows both hello and world. How to show just 
> hello keeping the world hidden and when clicked then only the world to 
> appear? 
>

-- 
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/d/optout.


[web2py] Re: please help with new widgets

2016-03-14 Thread xmarx
in mdipierro.github.io/stupid.css/widgets/index.html line 32: (chrome view 
source: view-source:http://mdipierro.github.io/stupid.css/widgets/index.html
)


should be:


i am not expert js or css. this is all I can do.


14 Mart 2016 Pazartesi 02:06:46 UTC+2 tarihinde Massimo Di Pierro yazdı:
>
> can somebody help me with this little project?
>
> http://mdipierro.github.io/stupid.css/widgets/index.html
> http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>
> Specifically, can you read the instructions? Do they make sense? can you 
> help extend them? Does everything work for you?
> I am planning to release a new library for web2py called form.py that will 
> replace SQLFORM and use the new widgets.
>
> Massimo
>

-- 
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/d/optout.


[web2py] Re: how to generate PDF documents in web2py???

2016-03-11 Thread xmarx
pyfpdf is installed on web2py. 

docs and tutorials can be found 
here: http://pyfpdf.readthedocs.org/en/latest/Web2Py/index.html

11 Mart 2016 Cuma 21:36:41 UTC+2 tarihinde prashant joshi yazdı:
>
> i want crete sql form if i click on print button then form printout in  
> pdf format 
> how it wiil done in web2py??
> how use ReportLab library??  
>

-- 
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/d/optout.


[web2py] Re: pdf utf-8 problem

2016-03-01 Thread xmarx
i haven't find solution yet but i found rigth source to 
explore. http://pyfpdf.readthedocs.org/en/latest/Web2Py/index.html

if i find, i will post here.

1 Mart 2016 Salı 21:04:44 UTC+2 tarihinde xmarx yazdı:
>
> i have a page in charset utf-8. 
>
> say testpdf.html
>
> when i type testpdf.pdf, some of non-ascii characters have been lost. what 
> can i do?
>
> second question, have can i specify styles of paragaphs, titles etc? it 
> doesn't recognize some of css styles. 
>
> thank you.
>

-- 
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/d/optout.


[web2py] pdf utf-8 problem

2016-03-01 Thread xmarx
i have a page in charset utf-8. 

say testpdf.html

when i type testpdf.pdf, some of non-ascii characters have been lost. what 
can i do?

second question, have can i specify styles of paragaphs, titles etc? it 
doesn't recognize some of css styles. 

thank you.

-- 
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/d/optout.


Re: [web2py] Re: ubuntu web2py

2016-02-20 Thread xmarx
thank you. it works.

10 Şubat 2016 Çarşamba 15:46:37 UTC+2 tarihinde Jim S yazdı:
>
> I got this working!
>
> Here is what I did.
>
> 1. Run the normal web2py installation script for nginx/ubuntu
> 2. sudo nano edit /etc/systemd/system/emperor.uwsgi.service
>
> Add these lines
> [Unit]
> Description = uWSGI Emperor
> After = syslog.target
>
>
> [Service]
> ExecStart = /usr/local/bin/uwsgi --ini /etc/uwsgi/web2py.ini
> RuntimeDirectory = uwsgi
> Restart = always
> KillSignal = SIGQUIT
> Type = notify
> StandardError = syslog
> NotifyAccess = all
>
>
> [Install]
> WantedBy = multi-user.target
>
> 3. Exit and save the file
> 4. systemctl enable emperor.uwsgi.service
> 5. systemctl start emperor.uwsgi.service
>
> You should now be able to browse to http://localhost or https://localhost
>
> On restart of the system, this service will automatically start.
>
> Let me know if you have questions.
>
> -Jim
>
> Thanks niphlod for the pointers and encouragement...
>

-- 
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/d/optout.


[web2py] Re: Apply where clause in external references

2016-02-17 Thread xmarx
users=db(db.user.stato==True).select()
for user in users:
#your code here



17 Şubat 2016 Çarşamba 10:18:40 UTC+2 tarihinde Alessio Varalta yazdı:
>
> Hi I have a class group and a class user for example. So i have a loop
>
> for row_user in row_group.user.select()
>
> now i want only the user that have status true
>
> i try for row_user in row_group.user.select(db.user.stato==True) but i 
> have a error or row_user in row_group.user.select(stato==True)
>
> How I can make this operation? Thanks in advance
>

-- 
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/d/optout.


[web2py] Re: web2py included on Synology DSM

2016-02-10 Thread xmarx
+1

10 Şubat 2016 Çarşamba 15:32:24 UTC+2 tarihinde Gerd yazdı:
>
> Hi!
>
> I would like to see web2py as a package for the Synology NAS, so i wrote 
> an inquery to the company at 
> https://www.synology.com/en-global/form/inquiry/feedback
>
> If you feel the same i suggest you to fill out the form and tell them that 
> we want it ;-)
>
> Thanks,
> Gerd
>

-- 
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/d/optout.


[web2py] Re: How to set default country in dropdown list

2016-02-09 Thread xmarx
db.define_table('Person',
Field('last_name', 'string'),
Field('name', 'string'),
Field('telephone', 'string'),
Field('email', 'string'),
Field('nationality','reference Nationalities',default=1), 
format= '%(last_name)s,%(name)s '
   )

default=the id of USA in Nationalities table



9 Şubat 2016 Salı 04:35:41 UTC+2 tarihinde Winter Kryz yazdı:
>
> Hello everybody,
>
> I am new in web2py, I have 2 tables called 'Nationalities' and 'Person'
>
> db.define_table('Nationalities',
> Field('description', 'string'),
> common_filter = lambda query:db.Nationalities.description 
> != 'United States',
> format='%(description)s'
>)
>
> db.define_table('Person',
> Field('last_name', 'string'),
> Field('name', 'string'),
> Field('telephone', 'string'),
> Field('email', 'string'),
> Field('nationality','reference 
> Nationalities',requires=IS_IN_DB(db(db.Nationalities.description), 
> 'Nationalities.description', zero=T('United States'))),
> format= '%(last_name)s,%(name)s '
>)
> in 'Nationalities', I have listed all the countries of world and what I 
> get is a dropdown list filled with them
> Now what I want to do is to display a particular country, let's say 
> 'United States', at top to be ID 0 in my dropdownlist so when somebody 
> fills the form the list shows 'United States' by default. I tried to do a 
> query that shows all the countries except US in the list and then set 'US' 
> as Zero but of course it didn't work because it says that the value that 
> zero has it doesn't exist on the database.
> Please, I need some help because I'm stuck on this.
> Thanks!
>

-- 
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/d/optout.


Re: [web2py] Re: ubuntu web2py

2016-02-06 Thread xmarx

selman@selman-VirtualBox:~$ ps -ewwf | grep uwsgi
selman1878  1848  0 18:15 pts/200:00:00 grep --color=auto uwsgi
selman@selman-VirtualBox:~$ sudo restart uwsgi-emperor
[sudo] password for selman: 
restart: Upstart'a bağlanılamıyor: Failed to connect to socket 
/com/ubuntu/upstart: Bağlantı reddedildi


english: could't connect upstart. Failed to connect to socket 
/com/ubuntu/upstart: connection denied.





6 Şubat 2016 Cumartesi 00:46:28 UTC+2 tarihinde Jim S yazdı:
>
> Also, what happens when you run:
>
> sudo restart uwsgi-emperor
>
>
> You should get something like this:
>
>
> uwsgi-emperor start/running, process 2749
>
>
> -Jim
>
>
>
> On Friday, February 5, 2016 at 4:34:54 PM UTC-6, Jim S wrote:
>>
>> Do you know if uwsgi is running:
>>
>> Try this from the command line...
>>
>> ps -ewwf | grep uwsgi
>>
>> results should look something like this:
>>
>> [image: Inline image 1]
>>
>> -Jim
>>
>>
>>
>> On Fri, Feb 5, 2016 at 3:18 PM, xmarx <selc...@gmail.com > 
>> wrote:
>>
>>> ubuntu 15.10 is running on vm VirtualBox.
>>> i exec the script and didn't install anything. nginx is installed by the 
>>> script and running.
>>> http://localhost/ and https://localhost/ raise 502 Bad Gateway page.
>>>
>>> there isn't a routes.py file in /home/www-data/web2py/
>>> web2py file is attached in /etc/nginx/sites-available/
>>>
>>> my script is: 
>>> https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
>>>
>>> thanks for your help Jim.
>>>
>>>
>>>
>>> 5 Şubat 2016 Cuma 21:56:00 UTC+2 tarihinde Jim S yazdı:
>>>>
>>>> Did you install nginx after running the script?  nginx is automatically 
>>>> installed by the script, you don't have to do it manually.
>>>>
>>>> If you didn't do that (I could be reading your message wrong), can you 
>>>> post the following files?
>>>>
>>>> /home/www-data/web2py/routes.py
>>>> /etc/nginx/sites-available/web2py
>>>>
>>>> They will tell us a bit about how it is behaving.
>>>>
>>>> -Jim
>>>>
>>>>
>>>> On Friday, February 5, 2016 at 1:28:10 PM UTC-6, xmarx wrote:
>>>>>
>>>>> i read the deployment recipes page and nginx section again and again. 
>>>>> i don`t see about `after install`
>>>>>
>>>>> i try install this script 
>>>>> http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh after 
>>>>> your message. when installing done. i type localhost on my browser. then 
>>>>> i 
>>>>> get web2py welcome page. but when i install nginx\ localhost is nginx`s 
>>>>> welcome page. 
>>>>>
>>>>> thanks.
>>>>>
>>>>> 5 Şubat 2016 Cuma 17:54:39 UTC tarihinde Jim S yazdı:
>>>>>>
>>>>>> Actually, this is the link you want:
>>>>>>
>>>>>> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Nginx
>>>>>>
>>>>>> Also, notice that there are automatic install scripts at the end of 
>>>>>> this section for ubuntu and nginx.
>>>>>>
>>>>>> Assuming you're in production, you don't 'have' to run under nginx, 
>>>>>> it is just recommended.  
>>>>>>
>>>>>> Once this is setup, web2py will be running through nginx and uwsgi, 
>>>>>> no need to 'start' it with the web2py.py pgm.
>>>>>>
>>>>>> If you read through the docs it is explained pretty well.
>>>>>>
>>>>>> -Jim
>>>>>>
>>>>>>
>>>>>> On Friday, February 5, 2016 at 11:52:16 AM UTC-6, Jim S wrote:
>>>>>>>
>>>>>>> Have you read through this?
>>>>>>>
>>>>>>>
>>>>>>> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Linux-and-Unix
>>>>>>>
>>>>>>> -Jim
>>>>>>>
>>>>>>> On Friday, February 5, 2016 at 11:33:57 AM UTC-6, xmarx wrote:
>>>>>>>>
>>>>>>>> i install on ubuntu web2py, nginx and uwsgi.
>>>>>>>>
>>>>>>>> when i run web2py (sudo python web2py.py) admin says Running on 
>>>>>>>> Rocket 1.2.6, Python 2.7.10.  
>>>>>>>>
>>>>>>>> where did i mistake? it must run on nginx, am i right?
>>>>>>>>
>>>>>>>> thanks.
>>>>>>>>
>>>>>>> -- 
>>> 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 a topic in the 
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/web2py/ZM9IIEjtHSI/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> web2py+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
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/d/optout.


[web2py] ubuntu web2py

2016-02-05 Thread xmarx
i install on ubuntu web2py, nginx and uwsgi.

when i run web2py (sudo python web2py.py) admin says Running on Rocket 
1.2.6, Python 2.7.10.  

where did i mistake? it must run on nginx, am i right?

thanks.

-- 
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/d/optout.


[web2py] Re: ubuntu web2py

2016-02-05 Thread xmarx
i read the deployment recipes page and nginx section again and again. i 
don`t see about `after install`

i try install this script 
http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh after your 
message. when installing done. i type localhost on my browser. then i get 
web2py welcome page. but when i install nginx\ localhost is nginx`s welcome 
page. 

thanks.

5 Şubat 2016 Cuma 17:54:39 UTC tarihinde Jim S yazdı:
>
> Actually, this is the link you want:
>
> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Nginx
>
> Also, notice that there are automatic install scripts at the end of this 
> section for ubuntu and nginx.
>
> Assuming you're in production, you don't 'have' to run under nginx, it is 
> just recommended.  
>
> Once this is setup, web2py will be running through nginx and uwsgi, no 
> need to 'start' it with the web2py.py pgm.
>
> If you read through the docs it is explained pretty well.
>
> -Jim
>
>
> On Friday, February 5, 2016 at 11:52:16 AM UTC-6, Jim S wrote:
>>
>> Have you read through this?
>>
>>
>> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Linux-and-Unix
>>
>> -Jim
>>
>> On Friday, February 5, 2016 at 11:33:57 AM UTC-6, xmarx wrote:
>>>
>>> i install on ubuntu web2py, nginx and uwsgi.
>>>
>>> when i run web2py (sudo python web2py.py) admin says Running on Rocket 
>>> 1.2.6, Python 2.7.10.  
>>>
>>> where did i mistake? it must run on nginx, am i right?
>>>
>>> thanks.
>>>
>>

-- 
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/d/optout.


[web2py] Re: ubuntu web2py

2016-02-05 Thread xmarx
ubuntu 15.10 is running on vm VirtualBox.
i exec the script and didn't install anything. nginx is installed by the 
script and running.
http://localhost/ and https://localhost/ raise 502 Bad Gateway page.

there isn't a routes.py file in /home/www-data/web2py/
web2py file is attached in /etc/nginx/sites-available/

my script is: 
https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh

thanks for your help Jim.



5 Şubat 2016 Cuma 21:56:00 UTC+2 tarihinde Jim S yazdı:
>
> Did you install nginx after running the script?  nginx is automatically 
> installed by the script, you don't have to do it manually.
>
> If you didn't do that (I could be reading your message wrong), can you 
> post the following files?
>
> /home/www-data/web2py/routes.py
> /etc/nginx/sites-available/web2py
>
> They will tell us a bit about how it is behaving.
>
> -Jim
>
>
> On Friday, February 5, 2016 at 1:28:10 PM UTC-6, xmarx wrote:
>>
>> i read the deployment recipes page and nginx section again and again. i 
>> don`t see about `after install`
>>
>> i try install this script 
>> http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh after 
>> your message. when installing done. i type localhost on my browser. then i 
>> get web2py welcome page. but when i install nginx\ localhost is nginx`s 
>> welcome page. 
>>
>> thanks.
>>
>> 5 Şubat 2016 Cuma 17:54:39 UTC tarihinde Jim S yazdı:
>>>
>>> Actually, this is the link you want:
>>>
>>> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Nginx
>>>
>>> Also, notice that there are automatic install scripts at the end of this 
>>> section for ubuntu and nginx.
>>>
>>> Assuming you're in production, you don't 'have' to run under nginx, it 
>>> is just recommended.  
>>>
>>> Once this is setup, web2py will be running through nginx and uwsgi, no 
>>> need to 'start' it with the web2py.py pgm.
>>>
>>> If you read through the docs it is explained pretty well.
>>>
>>> -Jim
>>>
>>>
>>> On Friday, February 5, 2016 at 11:52:16 AM UTC-6, Jim S wrote:
>>>>
>>>> Have you read through this?
>>>>
>>>>
>>>> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Linux-and-Unix
>>>>
>>>> -Jim
>>>>
>>>> On Friday, February 5, 2016 at 11:33:57 AM UTC-6, xmarx wrote:
>>>>>
>>>>> i install on ubuntu web2py, nginx and uwsgi.
>>>>>
>>>>> when i run web2py (sudo python web2py.py) admin says Running on Rocket 
>>>>> 1.2.6, Python 2.7.10.  
>>>>>
>>>>> where did i mistake? it must run on nginx, am i right?
>>>>>
>>>>> thanks.
>>>>>
>>>>

-- 
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/d/optout.


web2py
Description: Binary data


[web2py] Re: response.flash in custom view

2016-02-05 Thread xmarx
add this code to your view anywhere you want.
{{=response.flash}}

in layout.html 
{{=response.flash or ''}}


5 Şubat 2016 Cuma 09:57:25 UTC+2 tarihinde Joe yazdı:
>
> If I am not using {{extend 'layout.html'}} how can I make the 
> response.flash working in my template?
> Thanks.
>

-- 
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/d/optout.


[web2py] how to upgrade web2py on turnkey linux

2016-02-04 Thread xmarx
i install web2py on hub.turnkeylinux.org. web2py version is 2.12.3. when i 
upgrade web2py application admin gives an error but i can't see error page. 
from then, i can't do anything with web2py admin interface. i message to 
turnkeylinux support center but they haven't reply yet. so i have few 
questions. some of them are not about web2py, but if you help, i will be 
glad you.

1. how can access server via ftp. so able to install up to date web2py by 
hand.
2. how can i display turnkey servers on my amazon aws account.


-- 
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/d/optout.


[web2py] ubuntu vmware uwsgi

2016-01-26 Thread xmarx
i have ubuntu on vmware. install this 
<http://web2py.com/books/default/chapter/29/13/deployment-recipes#Nginx> 
(http://web2py.com/books/default/chapter/29/13/deployment-recipes#Nginx) 
steps. (actually i try short way)

script install web2py, nginx and other stuff. after install localhost/ have 
an error localhost. nginx is running. but uwsgi is not active. 

xmarx@xmarx-VirtualBox:~$ sudo service uwsgi start
[sudo] password for xmarx: 
Failed to start uwsgi.service: Unit uwsgi.service failed to load: No such 
file or directory.

how can i solve this problem?

-- 
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/d/optout.


[web2py] Re: How to make a form for accepting images (through default.py controller)?

2015-12-20 Thread xmarx
form = FORM(INPUT(_name='img', _type='file', 
upload=True),INPUT(_type='submit'))


19 Aralık 2015 Cumartesi 16:21:26 UTC+2 tarihinde RAGHIB R yazdı:
>
> form = FORM(INPUT(_name='img', upload=True),INPUT(_type='submit'))
>
> This is not working. What's wrong here?
>

-- 
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/d/optout.


[web2py] Re: manual form and SQLFORM question

2015-12-20 Thread xmarx
thanks Pierre. but i don't think i understand you clearly, sorry.

if i understand you correctly, you say why all checkbox inputs have same 
name (q). but they are checkboxes. they must have a same name. i will get 
selected inputs with request.post_vars or request.vars. 
when i submit first form, i get this. (response.toolbar)




i change form names, nothing changed. Also created both forms in 
controller, same issue. And last create both forms in one page, nothing 
changed. 



20 Aralık 2015 Pazar 17:48:06 UTC+2 tarihinde Pierre-Antoine Roiron yazdı:
>
> Hi,
> could it be that you don't increment your  ? I think that 
> html doesn't care, but when passing it to python ?
>

-- 
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/d/optout.


[web2py] manual form and SQLFORM question

2015-12-20 Thread xmarx
hi all.

page is here: https://xmarx.pythonanywhere.com/deneme/default/test1

i have a page has form that manually created. if submits page redirect new 
page that has a SQLFORM. i cannot have a result form second page.

def test1():
questions=[1,2,3,4,5,6,7,8,9,10]
return locals()


{{extend 'layout.html'}}
Select Questions 

{{for question in questions:}}
 
{{=question}}
{{pass}}
 



def test2():
if request.vars and request.vars.q:
selected_questions=request.vars.q
form=SQLFORM(db.test)
if form.process().accepted:
session.flash='Test added!'
redirect(URL('test3'))
else:
response.flash='form has an error.'
return locals()

test1.html display form. if i submit it redirects with post_vars to 
test2.html. but test2.html says "form has an error" when loading page. i 
mean i didn't fill second (SQLFORM) form and i didn't submit it.

if i fill second form and submit it, it didn't test3.html. nothing happend 
actually.



thanks.



-- 
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/d/optout.


[web2py] Re: How to make a form for accepting images (through default.py controller)?

2015-12-20 Thread xmarx
to make a form accepts only images see 
this: http://www.w3schools.com/tags/att_input_accept.asp

you can add _accept="image/*"

19 Aralık 2015 Cumartesi 16:21:26 UTC+2 tarihinde RAGHIB R yazdı:
>
> form = FORM(INPUT(_name='img', upload=True),INPUT(_type='submit'))
>
> This is not working. What's wrong here?
>

-- 
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/d/optout.


[web2py] Re: manual form and SQLFORM question

2015-12-20 Thread xmarx
i want to do this: user selects some of the questions (checkboxes) and 
saves them a test (SQLFORM). it doesn't matter how to do this. with or 
without form, redirects or in one page. 
i was using q's to retrieve selected checboxes,

i did it with jquery. my way:

page1: test.html

select page. i retrieve selected questions with jquery and generate a link 
like this: /create_test?questions=1,2,3,4,9,10

page2: create_test.html

save test with questions, gives name with SQLFORM.

it works. 

my db:

db.define_table('questions',Field('question_image')...)


db.define_table('tests',Field('name'),Field('questions').)


i didn't use list:reference. i store question ids as string seperated with 
comma.


20 Aralık 2015 Pazar 21:16:24 UTC+2 tarihinde Anthony yazdı:
>
> On Sunday, December 20, 2015 at 6:39:45 AM UTC-5, xmarx wrote:
>>
>>
>> def test2():
>> if request.vars and request.vars.q:
>> selected_questions=request.vars.q
>> form=SQLFORM(db.test)
>> if form.process().accepted:
>> session.flash='Test added!'
>> redirect(URL('test3'))
>> else:
>> response.flash='form has an error.'
>> return locals()
>>
>> test1.html display form. if i submit it redirects with post_vars to 
>> test2.html. but test2.html says "form has an error" when loading page. i 
>> mean i didn't fill second (SQLFORM) form and i didn't submit it.
>>
>
> You only have two conditions: (1) the form is accepted, (2) the "form has 
> an error" message is displayed. The form is only accepted after it has been 
> submitted and passed validation, so in all other cases (e.g., when the form 
> is first created), you will get the error message. If you look at the book 
> examples, you will see there are three conditions, with an error message 
> displayed only via an "elif form.errors" condition. 
>
> if i fill second form and submit it, it didn't test3.html. nothing happend 
>> actually.
>>
>
> All of your form logic is inside an "if request.vars.q" condition. 
> However, "q" is in request.vars only upon the initial redirect from test1, 
> which results in the blank test2 form being created. When you then submit 
> the test2 form, there is no longer a "q" variable in request.vars, so all 
> of the form code in test2 is skipped.
>
> Hard to say what the best approach would be without knowing what you're 
> doing with "q" (i.e., does it need to persist past the initial redirect?), 
> but you'll need some logic to ensure the test2 form code gets run once its 
> form is submitted.
>
> Anthony
>

-- 
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/d/optout.


[web2py] Re: How to upload a file in a directory without SQLFORM ?

2015-12-16 Thread xmarx
in controller:

def index():
import os
form=SQLFORM.factory(Field('name'),Field('file', 
'upload',uploadfolder=os.path.join(request.folder,'uploads')))
if form.process().accepted:
request.flash='file uploaded!'
return dict(form=form)



in view index.html:

{{extend 'layout.html'}}

Upload File
{{=form}}




thats it.

16 Aralık 2015 Çarşamba 11:07:11 UTC+2 tarihinde Adrien yazdı:
>
>
> Hi everyone,
> Like i said in the title, i want to upload a file in a directory with a 
> form.
> I saw another subject where he did what i want but with me, it doesn't 
> work and i don't know why. 
>
> This is my controller default.py : 
> def test():
> import shutil
>
> filename=request.vars.filename
> file=request.vars.file
> shutil.copyfileobj(file,open('path/'+filename,'wb'))
> return dict()
>
> def index():
> return dict()
>
> And the view index.html : 
> 
> 
> 
>  
>
> Do someone knows how to fix this problem ? And sorry but I'm not english, 
> i hope i'm clear for you. 
>

-- 
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/d/optout.


[web2py] Re: How to not show menu bar in certain views and keep the view look normal?

2015-12-14 Thread xmarx
you can edit layout.html.

for delete menu you can customize this lines.

  
  
{{=response.flash or ''}}

  
{{=response.logo or ''}}

  {{='auth' in globals() and auth.navbar(mode="dropdown") or ''}}


  {{if response.menu:}}
  {{=MENU(response.menu)}}
  {{pass}}

  

  



15 Aralık 2015 Salı 07:17:58 UTC+2 tarihinde RAGHIB R yazdı:
>
> When I remove "{{extend 'layout.html'}}" it looks so dull. I just want to 
> remove the menu bar and nothing else.
>

-- 
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/d/optout.


[web2py] how can i learn number of row

2015-12-14 Thread xmarx
i want to learn number of rows from Rows object in view. 


in controller:
rows=db(db.test).select()

in view:

{{=rows.length}}

id didn't work.

AttributeError: 'Rows' object has no attribute 'length'

-- 
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/d/optout.


Re: [web2py] view question

2015-11-26 Thread xmarx
thanks Richard. but it didn't work. table works.

Test 

 1
 2


 1
 2


 1
 2





1
2
3


4
5
6





this code in browser look like this:





in browsers print page:






now, the question is, how can i sort items of a list using for statement?






26 Kasım 2015 Perşembe 20:16:45 UTC+2 tarihinde Richard yazdı:
>
> Did you surround you col-sm-6 div by a class=row div?
>
> On Thu, Nov 26, 2015 at 12:50 PM, Selman Kocael  > wrote:
>
>> I want to print a page like this:
>>
>>
>> [image: Satır içi resim 2]
>>
>> but in google chrome's print page it looks like this: 
>>
>> [image: Satır içi resim 3]
>>
>>
>> how can I do two column.
>>
>> i tried this in divs with class col-sm-6.
>>
>> thanks.
>>
>> -- 
>> Selman Kocael
>> İsabet Yayınları
>>
>> -- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/d/optout.


[web2py] Re: TABLE--TR--TD in web2py book

2015-09-01 Thread xmarx
This is a shortcut that allows you to pass multiple arguments to a function 
directly list. source: 
http://stackoverflow.com/questions/36901/what-does-double-star-and-star-do-for-python-parameters


TABLE(*[TR(*rows) for rows in table])


TABLE
is a function that can takes list argument. 

[TR(*rows) for rows in table] 
is a list.



 

31 Ağustos 2015 Pazartesi 23:33:23 UTC+3 tarihinde Mamisoa Andriantafika 
yazdı:
>
> Thank you for your highlight. You helped me to better understand the 
> iteration.
>
> My main misunderstanding was actually the "*" before the "[(TR" ?
>
> Le lundi 31 août 2015 01:07:47 UTC+2, Anthony a écrit :
>>
>> [TR(*rows) for rows in table] is a list comprehension -- it iterates 
>> over the items in "table" (which are themselves lists) and creates a new 
>> list of TR objects.
>>
>> The "*" before the list is Python syntax for argument unpacking, treating 
>> each item in the list as if it were a separate positional argument.
>>
>> Note, technically argument unpacking is not necessary for TABLE nor for 
>> TR, as both will alternatively accept a list as the first argument. So, the 
>> code could be changed to:
>>
>> TABLE([TR(row) for row in table])
>>
>>
>> Anthony
>>
>> On Sunday, August 30, 2015 at 1:20:38 PM UTC-4, Mamisoa Andriantafika 
>> wrote:
>>>
>>> Hi,
>>>
>>> Could you explain to me how this code works?
>>>
>>> http://web2py.com/books/default/chapter/29/05/the-views#TABLE--TR--TD
>>>
>>> >>> table = [['a', 'b'], ['c', 'd']]
>>> >>> print TABLE(*[TR(*rows) for rows in table])
>>> abcd
>>>
>>>
>>> I do not completely understand how the loop is created there?
>>>
>>> Thank you for your highlight.
>>>
>>> Mike
>>>
>>

-- 
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/d/optout.


[web2py] Re: How accept latin letters on args

2015-08-31 Thread xmarx
you can set title of the post at vars. 

for example: 
/application/cms/post/12345?title=çışöğüã+ğüã+ğüã


or you can set non-unicode letters to similar unicode letters. that 
readable by reader.

for example: 
/application/cms/post/12345/cisogua_gua_gua



30 Ağustos 2015 Pazar 02:03:38 UTC+3 tarihinde Leonardo Pires Felix yazdı:
>
> Hi guys,
>
> I'm doing a little CMS for my application,
>
> My application can have some posts, so every post should be in a url like 
> this /application/cms/post/{arg0:postid}/{arg1:the title of the post).
> The title of the post i'll not use it, it's just for a more friendly url. 
> But if the title has non utf-8 letters like ç or ã web2py raises a invalid 
> request.
>
> There is a way to accept those letters on args?
>

-- 
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/d/optout.


[web2py] Re: When will we have a proper forum ?

2015-08-05 Thread xmarx



 It does have tags: https://groups.google.com/forum/#!tags/web2py


but unfortunatelyit doesn't using effectively. because i think. most 
messages send and replied vie e-mail. 


it would be nice to have the following features in 'new forum' or whatever.
1. transfer or copy all google groups messages to new forum.
2. auto-tagging or tag-suggesting system. 

-- 
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/d/optout.


[web2py] format question

2015-07-12 Thread xmarx

In db, Does referenced field stored as formatted, or as id?

for example:

db.define_table('group',
   Field('name'),
   format = %(name)s)

db.define_table('person',
   Field('name'),
   Field('sirname'),
   Field('group', 'reference group'))


in second table, when i want select rows with group value, how can i do 
this.

db(db.person.group=='manager').select()


OR

db(db.person.group==1).select()



thanks.

-- 
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/d/optout.


[web2py] Plugins Error

2015-05-12 Thread xmarx
hi!

when i click from design page 
(http://127.0.0.1:8000/admin/default/design/examples) download plugins 
from repository button, i get an error like this:

TypeError: list indices must be integers, not str


screenshot is there.

Thank you.


-- 
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/d/optout.