[web2py] DAL how to show only some of the lines in a db

2013-03-26 Thread Hugo Costa
Hi,

In my website I want to put only 5 news in the page main page that are 
stored in a mongodb.

Can anyone tell me how to do it?

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.




[web2py] Image in web2py/MongoDB based blog

2013-03-26 Thread Hugo Costa
Hi!

So, I'm setting up a website where there will be a blog system where I can 
create my news using a simple form and store that in a mongo database, but 
I want to know how can I put an image/video in the text making them appear 
in the view of the user.

I tried using with HTML code but it didn't work.

Can any one gimme a hand on this?

Thanks,

Hugo

-- 

--- 
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: DAL how to show only some of the lines in a db

2013-03-26 Thread Hugo Costa
Thanks! ;)

Terça-feira, 26 de Março de 2013 18:10:47 UTC, Cliff Kachinske escreveu:
>
>
> http://web2py.com/books/default/chapter/29/06#orderby,-groupby,-limitby,-distinct,-having
>
> On Tuesday, March 26, 2013 2:00:36 PM UTC-4, Hugo Costa wrote:
>>
>> Hi,
>>
>> In my website I want to put only 5 news in the page main page that are 
>> stored in a mongodb.
>>
>> Can anyone tell me how to do it?
>>
>> 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.




[web2py] Re: Image in web2py/MongoDB based blog

2013-03-27 Thread Hugo Costa
Thanks for the answer.

Isn't there a way to put images using links from other storage websites in 
the form? Because I'm not going to be the only administrating the site and 
they won't know how to work with the thing in that first link.

Terça-feira, 26 de Março de 2013 21:51:21 UTC, Alan Etkin escreveu:
>
> > but I want to know how can I put an image/video in the text making them 
> appear in the view of the user.
> > I tried using with HTML code but it didn't work.
>
> Where will the images come from?
>
> Will you store image files in you app folder?
>
> Here is a guide to handle images from the book:
>
> http://www.web2py.com/books/default/chapter/29/03#An-image-blog
>
> If you just need a way of adding images to you views, check the img helper 
> here
>
> http://www.web2py.com/books/default/chapter/29/05
>
>
>

-- 

--- 
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] The connection to mongodb://localhost/test could not be made

2013-06-15 Thread Hugo Costa
Hey,

So I returned to the web2py and I found this error on my website.

I haven't been with the website for a while, and I do not understand this 
error.

My db.py:

## if SSL/HTTPS is properly configured and you want all HTTP requests to
## be redirected to HTTPS, uncomment the line below:
# request.requires_https()

if not request.env.web2py_runtime_gae:
## if NOT running on Google App Engine use SQLite or other DB
#db = DAL('sqlite://storage.sqlite', pool_size=1, 
check_reserved=['all'], migrate=False)
#db = ('mongodb://localhost/test')
db = DAL("mongodb://localhost/test",
check_reserved=["mongodb_nonreserved",],
adapter_args={"safe":False})
else:
## connect to Google BigTable (optional 'google:datastore://namespace')
db = DAL('google:datastore')
## store sessions and tickets there
session.connect(request, response, db=db)
## or store session in Memcache, Redis, etc.
## from gluon.contrib.memdb import MEMDB
## from google.appengine.api.memcache import Client
## session.connect(request, response, db = MEMDB(Client()))

## by default give a view/generic.extension to all actions from localhost
## none otherwise. a pattern can be 'controller/function.extension'
response.generic_patterns = ['*'] if request.is_local else []
## (optional) optimize handling of static files
# response.optimize_css = 'concat,minify,inline'
# response.optimize_js = 'concat,minify,inline'

What can I do?

Thanks,

Hugo

-- 

--- 
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] Use Custom Fonts

2013-07-07 Thread Hugo Costa
Hello!

I want to use a custom type of font (downloaded from dafont) in my navbar.

How can I do that? I have the .tff file.

Thanks,

Hugo

-- 

--- 
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: Use Custom Fonts

2013-07-07 Thread Hugo Costa
Thanks!

Hugo

Domingo, 7 de Julho de 2013 23:33:59 UTC+1, lesssugar escreveu:
>
> Not really a web2py thing. Check the liks below.
>
> CSS3 font-face (general usage): 
> http://www.css3.info/preview/web-fonts-with-font-face/
>
> Webfont generator (for the font you downloaded): 
> http://www.fontsquirrel.com/tools/webfont-generator
>
> On Sunday, July 7, 2013 9:56:15 PM UTC+2, Hugo Costa wrote:
>>
>> Hello!
>>
>> I want to use a custom type of font (downloaded from dafont) in my navbar.
>>
>> How can I do that? I have the .tff file.
>>
>> Thanks,
>>
>> Hugo
>>
>

-- 

--- 
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] Sapo Ink and Web2py

2013-08-04 Thread Hugo Costa
Hello!

So, my friend who was using *Twitter Bootstrap *changed to Sapo 
Ink, 
and he loved it. 

I currently have my apps in Bootstrap, but I wanted to change them to the 
Sapo's framework.

Anyone knows what should I delete to make this work? I have some of the 
features, I've deleted most of the bootstrap stuff and copied the Sapo's 
files to the respective folders but I don't have all the features.

Anyone can help me?

Thanks

Hugo

-- 

--- 
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: IS web2py good for largescale

2013-08-04 Thread Hugo Costa
My cousin is making a social network using web2py and he worked with Rails, 
for example.

I'd use it, I think it has a clean and easy code. But that's up to you.

If you want to know what social network it is, http://tymr.com

Sexta-feira, 2 de Agosto de 2013 4:04:27 UTC+1, hello world escreveu:
>
> Hey
> I would like to know if web2py framework ...is a good framework for making 
> large scale websites...???..
>

-- 

--- 
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] Bootstrap Carousel and bootstrap

2013-08-07 Thread Hugo Costa
Hello!

I'm doing a website where I have a carousel in which should be the 3 latest 
news, going to search for Title, Content and Date to the database but isn't 
working like I wanted.

The code:

*default.py*

def index():
"""
example action using the internationalization operator T and flash
rendered by views/default/index.html or views/generic.html

if you need a simple wiki simple replace the two lines below with:
return auth.wiki()
"""
if auth.user:
response.flash = T('Welcome %s %s' % (auth.user.first_name, 
auth.user.last_name))
else:
response.flash = T('Welcome Visitor')
news = db(db.posts).select(orderby=~db.posts.id, limitby=(0, 3))
return dict(news=news)

 *index.html*
*
*
{{for post in news:}}








  
http://payload.cargocollective.com/1/0/221/2318/08-Poster-2_900.jpg";>

  {{=post.title}}
  {{=XML(markdown(post.post))}}
  {{=post.created_on}}

  
  


  
  

  
  

  

{{pass}}

If you guys could give me a hand on this I'd apreciate it :)

Thanks,

Hugo

-- 

--- 
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] Bootstrap Carousel and bootstrap

2013-08-07 Thread Hugo Costa
Hey Roberto!

So, I've used your code and this turned out:

*index.html*
*
*


  



  
  
{{for post in news:}}
{{if index==0:}}
   
   {{=post.title}}
   {{=post.post}}
   {{=post.created_on}}
   
{{else}}
   
{{pass}}
{{pass}}
  
  ‹
  ›




I don't understand why, but I'm getting this error:

 invalid syntax (index.html, line 70)

What could it be?

Quarta-feira, 7 de Agosto de 2013 18:37:54 UTC+1, Roberto Perdomo escreveu:
>
> Hi Hugo, I dont know bootstrap carousel, but in the view you are iterating 
> many times the main div "carousel-example-generic".
>
> In your case you need iterate only the dinamic content of the carousel, 
> and the carousel content are divs.
>
> See this example with my comments:
>
> 
>   
>  
>  class="active">
> 
> 
>   
>   
>   
> 
> 
> 
> 
>  />
> 
> 
>   
>   
>data-slide="prev">‹
>data-slide="next">›
> 
>
> hope I've helped with this example.
>
>
> 2013/8/7 Hugo Costa >
>
>> Hello!
>>
>> I'm doing a website where I have a carousel in which should be the 3 
>> latest news, going to search for Title, Content and Date to the database 
>> but isn't working like I wanted.
>>
>> The code:
>>
>> *default.py*
>>
>> def index():
>> """
>> example action using the internationalization operator T and flash
>> rendered by views/default/index.html or views/generic.html
>>
>> if you need a simple wiki simple replace the two lines below with:
>> return auth.wiki()
>> """
>> if auth.user:
>> response.flash = T('Welcome %s %s' % (auth.user.first_name, 
>> auth.user.last_name))
>> else:
>> response.flash = T('Welcome Visitor')
>> news = db(db.posts).select(orderby=~db.posts.id, limitby=(0, 3))
>> return dict(news=news)
>>
>>  *index.html*
>> *
>> *
>> {{for post in news:}}
>> 
>> 
>> > class="">
>> > class="">
>> > class="">
>> 
>>
>> 
>>   
>> > alt="900x500" src="
>> http://payload.cargocollective.com/1/0/221/2318/08-Poster-2_900.jpg";>
>> 
>>   {{=post.title}}
>>   {{=XML(markdown(post.post))}}
>>   {{=post.created_on}}
>> 
>>   
>>   
>> 
>> 
>>   
>>   > data-slide="prev">
>> 
>>   
>>   > data-slide="next">
>> 
>>   
>> 
>> {{pass}}
>>
>> If you guys could give me a hand on this I'd apreciate it :)
>>
>> Thanks,
>>
>> Hugo
>>
>> -- 
>>  
>> --- 
>> 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/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.




Re: [web2py] Bootstrap Carousel and bootstrap

2013-08-08 Thread Hugo Costa
Sorry about the delay.

The first one works fine, but only works for the first and the second.

The code I used is:

*index.html*
*
*

  



  
  
{{for index, post in enumerate(news):}}

{{if index==0:}}
   
   {{=post.title}}
   {{=post.post}}
   {{=post.created_on}}
   
{{pass}}

{{else:}}
   
{{=post.title}}
   {{=post.post}}
   {{=post.created_on}}
   
{{pass}}
{{pass}}
  
  ‹
  ›



What could it be? 

Quarta-feira, 7 de Agosto de 2013 20:56:17 UTC+1, Roberto Perdomo escreveu:
>
> you forgot the ":" on the else and pass on the if. index var not exist, 
> was my example, you need get the index of the iteration, may be with 
> news.index(post) or using enumerate. Try this two example:
>
> 
>   
>  class="active">
>  data-slide-to="1">
>  data-slide-to="2">
>   
>   
> {{for index, post in enumerate(news):}}
> {{if index==0:}}
> src="{{=URL('static','images/carousel/%s' %(post.image))}}" alt="banner1" />
>{{=post.title}}
>{{=post.post}}
>{{=post.created_on}}
>
> {{pass}}
> {{else:}}
> src="{{=URL('static','images/carousel/%s' %(post.image))}}" alt="banner2" 
> />
> {{pass}}
> {{pass}}
>   
>href="#carousel-example-generic" data-slide="prev">‹
>href="#carousel-example-generic" data-slide="next">›
> 
> 
>
> or:
>
> 
>   
>  class="active">
>  data-slide-to="1">
>  data-slide-to="2">
>   
>   
> {{for post in news:}}
> {{if news.index(post)==0:}}
> src="{{=URL('static','images/carousel/%s' %(post.image))}}" alt="banner1" />
>{{=post.title}}
>{{=post.post}}
>    {{=post.created_on}}
>
> {{pass}}
> {{else:}}
> src="{{=URL('static','images/carousel/%s' %(post.image))}}" alt="banner2" 
> />
> {{pass}}
> {{pass}}
>   
>href="#carousel-example-generic" data-slide="prev">‹
>href="#carousel-example-generic" data-slide="next">›
> 
> 
>
> Is an example, this was not tested
>
>
> 2013/8/7 Hugo Costa >
>
>> Hey Roberto!
>>
>> So, I've used your code and this turned out:
>>
>> *index.html*
>> *
>> *
>> 
>>
>>   
>> > class="active">
>> > data-slide-to="1">
>> > data-slide-to="2">
>>   
>>   
>> {{for post in news:}}
>> {{if index==0:}}
>>>  src="{{=URL('static','images/carousel/%s' %(post.image))}}" alt="banner1" 
>> />
>>{{=post.title}}
>>{{=post.post}}
>>{{=post.created_on}}
>>
>> {{else}}
>>>  src="{{=URL('static','images/carousel/%s' %(post.image))}}" alt="banner2" 
>> />
>> {{pass}}
>> {{pass}}
>>   
>>   > href="#carousel-example-generic" data-slide="prev">‹
>>   > href="#carousel-example-generic" data-slide="next">›
>> 
>> 
>>
>>
>> I don't understand why, but I'm getting this error:
>>
>>  invalid syntax (index.html, line 70)
>>
>> What could it be?
>>
>> Quarta-feira, 7 de Agosto de 2013 18:37:54 UTC+1, Roberto Perdomo 
>> escreveu:
>>>
>>> Hi Hugo, I dont know bootstrap carousel, but in the view you are iterating 
>>> many times the main div "carousel-example-generic".
>>>
>>> In your case you need iterate only the dinamic content of the carousel, 
>>> and the carousel content are divs.
>>>
>>> See this example with my comments:
>>>
>>> 
>>>   
>>>  
>>> >> class="active">
>>> 
>>&

Re: [web2py] Bootstrap Carousel and bootstrap

2013-08-08 Thread Hugo Costa
Yeah, I have. 3 is the magic number :)

I did not understand this question.

The third is missing 





   
   Azeite Vinaldo
   Guache sobre Tela, 75x30 cm.
   2013-08-07 18:03:38.774240
 
   
Bezegaio Frito
   Acrilico sobre Tela, 45x40 cm
   2013-08-07 17:52:27.399172
   


  

The code in the source in browser.

Quinta-feira, 8 de Agosto de 2013 19:43:36 UTC+1, Roberto Perdomo escreveu:
>
> Good news!
>
> You really have three post?
> Can you print the three posts in a .html without carousel?
> You have checked the source of your index.html (in the browser) and search 
> the three div inside "carousel-inner"?
>
>
> 2013/8/8 Hugo Costa >
>
>> Sorry about the delay.
>>
>> The first one works fine, but only works for the first and the second.
>>
>> The code I used is:
>>
>> *index.html*
>> *
>> *
>> 
>>   
>> > class="active">
>> > data-slide-to="1">
>> > data-slide-to="2">
>>   
>>   
>> {{for index, post in enumerate(news):}}
>>
>> {{if index==0:}}
>>>  src="{{=URL('static','images/carousel/%s' %(post.image))}}" alt="banner1" 
>> />
>>{{=post.title}}
>>{{=post.post}}
>>{{=post.created_on}}
>>
>> {{pass}}
>>
>> {{else:}}
>>>  src="{{=URL('static','images/carousel/%s' %(post.image))}}" alt="banner2" 
>> />
>> {{=post.title}}
>>{{=post.post}}
>>{{=post.created_on}}
>>
>> {{pass}}
>> {{pass}}
>>   
>>   > href="#carousel-example-generic" data-slide="prev">‹
>>   > href="#carousel-example-generic" data-slide="next">›
>> 
>> 
>>
>> What could it be? 
>>
>> Quarta-feira, 7 de Agosto de 2013 20:56:17 UTC+1, Roberto Perdomo 
>> escreveu:
>>>
>>> you forgot the ":" on the else and pass on the if. index var not exist, 
>>> was my example, you need get the index of the iteration, may be with 
>>> news.index(post) or using enumerate. Try this two example:
>>>
>>> 
>>>   
>>> >> data-slide-to="0" class="active">
>>> >> data-slide-to="1">
>>> >> data-slide-to="2">
>>>   
>>>   
>>> {{for index, post in enumerate(news):}}
>>> {{if index==0:}}
>>>
>>>{{=post.title}}
>>>{{=post.**post}}
>>>{{=post.**created_on}}
>>>
>>> {{pass}}
>>> {{else:}}
>>>>> src="{{=URL('static','images/**carousel/%s' 
>>> %(post.image))}}" alt="banner2" />
>>> {{pass}}
>>> {{pass}}
>>>   
>>>   >> href="#carousel-example-**generic" data-slide="prev">‹
>>>   >> href="#carousel-example-**generic" data-slide="next">›
>>> 
>>> 
>>>
>>> or:
>>>
>>> 
>>>   
>>> >> data-slide-to="0" class="active">
>>> >> data-slide-to="1">
>>> >> data-slide-to="2">
>>>   
>>>   
>>> {{for post in news:}}
>>> {{if news.index(post)==0:}}
>>>
>>>{{=post.title}}
>>>{{=post.**post}}
>>>{{=post.**created_on}}
>>>
>>> {{pass}}
>>> {{else:}}
>>>>> src="{{=URL('static','images/**carousel/%s' 
>>> %(post.image))}}" alt="banner2" />
>>> {{pass}}
>>> {{pass}}
>>>   
>>>   >> href="#carousel-example-**generic" data-slide="prev">‹
>>>   >> href="#carousel-example-**generic" data-slide="next&

Re: [web2py] Bootstrap Carousel and bootstrap

2013-08-08 Thread Hugo Costa
You sir, made my day.

Thanks a lot Roberto! :)

Quinta-feira, 8 de Agosto de 2013 20:33:45 UTC+1, Roberto Perdomo escreveu:
>
> The {{pass}} of the if is not needed :-S
>
>
> 2013/8/8 Hugo Costa >
>
>> Yeah, I have. 3 is the magic number :)
>>
>> I did not understand this question.
>>
>> The third is missing 
>>
>> 
>> 
>>
>> 
>>> src="/diogo/static/images/carousel/carousel3.jpg" alt="banner1">
>>Azeite Vinaldo
>>Guache sobre Tela, 75x30 cm.
>>2013-08-07 18:03:38.774240
>>  
>>> src="/diogo/static/images/carousel/carousel1.jpg" alt="banner2">
>> Bezegaio Frito
>>Acrilico sobre Tela, 45x40 
>> cm
>>2013-08-07 17:52:27.399172
>>
>> 
>> 
>>   
>>
>> The code in the source in browser.
>>
>> Quinta-feira, 8 de Agosto de 2013 19:43:36 UTC+1, Roberto Perdomo 
>> escreveu:
>>>
>>> Good news!
>>>
>>> You really have three post?
>>> Can you print the three posts in a .html without carousel?
>>> You have checked the source of your index.html (in the browser) and 
>>> search the three div inside "carousel-inner"?
>>>
>>>
>>> 2013/8/8 Hugo Costa 
>>>
>>> Sorry about the delay.
>>>>
>>>> The first one works fine, but only works for the first and the second.
>>>>
>>>> The code I used is:
>>>>
>>>> *index.html*
>>>> *
>>>> *
>>>> 
>>>>   
>>>> >>> data-slide-to="0" class="active">
>>>> >>> data-slide-to="1">
>>>> >>> data-slide-to="2">
>>>>   
>>>>   
>>>>  {{for index, post in enumerate(news):}}
>>>>
>>>> {{if index==0:}}
>>>>
>>>>{{=post.title}}
>>>>{{=post.**post}}
>>>>{{=post.**created_on}}
>>>>
>>>> {{pass}}
>>>>
>>>> {{else:}}
>>>>>>> src="{{=URL('static','images/**carousel/%s' 
>>>> %(post.image))}}" alt="banner2" />
>>>> {{=post.title}}
>>>>{{=post.**post}}
>>>>{{=post.**created_on}}
>>>>
>>>> {{pass}}
>>>> {{pass}}
>>>>   
>>>>   >>> href="#carousel-example-**generic" data-slide="prev">‹
>>>>   >>> href="#carousel-example-**generic" data-slide="next">›
>>>> 
>>>> 
>>>>
>>>> What could it be? 
>>>>
>>>> Quarta-feira, 7 de Agosto de 2013 20:56:17 UTC+1, Roberto Perdomo 
>>>> escreveu:
>>>>>
>>>>> you forgot the ":" on the else and pass on the if. index var not 
>>>>> exist, was my example, you need get the index of the iteration, may be 
>>>>> with 
>>>>> news.index(post) or using enumerate. Try this two example:
>>>>>
>>>>> 
>>>>>   
>>>>> >>>> data-slide-to="0" class="active">
>>>>> >>>> data-slide-to="1">
>>>>> >>>> data-slide-to="2">
>>>>>   
>>>>>   
>>>>> {{for index, post in enumerate(news):}}
>>>>> {{if index==0:}}
>>>>>    
>>>>>{{=post.title}}
>>>>>{{=post.**po**st}}
>>>>>{{=post.**cre**ated_on}}
>>>>>
>>>>> {{pass}}
>>>>> {{else:}}
>>>>>>>>> src="{{=URL('static','images/**c**arousel/%s' 
>>>>> %(post.image))}}" alt="banner2" />
>>>>> {{pass}}
>>>>> {{pass}}
>>>>>   
>