Re: [web2py] Re: web2py on github

2011-12-21 Thread Daniel Aguayo Catalán

mdipierro escribió:

I somebody wants to keep an official mirror there I have no
objection. I prefer to stick with mercurial on Google because
mercurial is 100% python.

On Apr 5, 1:53 am, elffikkelff...@gmail.com  wrote:

hi,

I use a few project stored on github, and I find it easier to navigate
source code or to get a trunk version.
What about moving web2py on github?
I'm sorry to bump this out (and/or could be kind of obvious), but why 
github and not bitbucket?


Re: [web2py] Re: web2py on github

2011-12-21 Thread Daniel Aguayo Catalán

Daniel Aguayo Catalán escribió:

mdipierro escribió:

I somebody wants to keep an official mirror there I have no
objection. I prefer to stick with mercurial on Google because
mercurial is 100% python.

On Apr 5, 1:53 am, elffikkelff...@gmail.com  wrote:

hi,

I use a few project stored on github, and I find it easier to navigate
source code or to get a trunk version.
What about moving web2py on github?
I'm sorry to bump this out (and/or could be kind of obvious), but why 
github and not bitbucket?


I'm new to bitbucket but I see that it also supports git, so... it's the 
github interface the killer feature? the 5 users cap for free accounts?


Re: [web2py] Re: web2py on github

2011-12-21 Thread Daniel Aguayo Catalán

Bruce Wade escribió:
My problem with bitbucket is the 5 cap for free private, if you are 
wanting to use git and keep the projects public I recommend gitorious.
I like gitorious because it's FLOSS and 'eats its own dog food' 
(gitorious code is hosted on gitorious), but private projects **for 
free** (as in beer) on bitbucket are useful, example, for personal 
project I don't want to release until they're finished. github doesn't 
allow any private project for free and gitorious doesn't have this 
feature yet (but it is in the roadmap and will not be free as in beer).


I know that web2py doesn't need a private project option, but since 
bitbucket is also free and support git, has issue tracker, wiki, etc, 
why use github? I really want to know...





Re: [web2py] Web Development Introduction Based On Web2py

2011-12-21 Thread Daniel Aguayo Catalán

ma...@rockiger.com escribió:
Should go away, when all dns servers are updated. 

Hi,

at http://killer-web-development.com/section/1/3 shows a diagram that 
try to explain the MVC pattern that says:


[USER - CONTROLLER - VIEW,  USER - CONTROLLER - MODEL - DATABASE]


...but I think it should be as follows:

[USER - VIEW - CONTROLLER - MODEL - DATABASE]

...because user just interact directly with Views and these make the 
request to controllers and/or models. Or am I wrong?




Re: [web2py] Re: web2py on github

2011-12-21 Thread Daniel Aguayo Catalán

Massimo Di Pierro wrote:

I hate all changes related to this topic. This is because I have to
learn a new system and do extra work to move stuff around. There was a
lot of push for git and github so we did it.

Please, let's not open this can of worms again. The costs of changing
outweighs the benefits.

Massimo

He he, don't worry :). My apologies if this topic is still kind of 
sensible. I thought that bitbucket was more restrictive and the free 
private project hosting was a plus and killer feature over other 
services, at least for me (that sadly have not gitourious nor github). 
So I just wanna to know a comparison of bitbucket and github from your 
perspective to choose my personal repo, but now I can see that was 
nothing in particular.


I know that github is the 'pop-choice' for project hosting these days 
and I have no problem with that (gitorious.org and bitbucket has fairly 
same workflow as github), so please don't considerate this as a kind of 
flame of DVCS hosting.


Thanks to all for your answer.
Best regards
--
Daniel


[web2py] problem with request.date and db.table.update_or_insert

2011-12-14 Thread Daniel Aguayo Catalán

  
  
Hi,

i have a fieldtype 'date' in a table that I cannot create from using
request.now.date() in the db.table.update_or_insert statement (even
if a change the fieldtype and date value to string)

Traceback (most recent call last):
  File "/home/danto/web2py/gluon/restricted.py", line 204, in restricted
exec ccode in environment
  File "/home/danto/web2py/applications/votomercado/controllers/info.py", line 428, in module
  File "/home/danto/web2py/gluon/globals.py", line 162, in lambda
self._caller = lambda f: f()
  File "/home/danto/web2py/applications/votomercado/controllers/info.py", line 176, in historico_brand
fecha = date
  File "/home/danto/web2py/gluon/dal.py", line 5617, in update_or_insert
record = self(**values)
  File "/home/danto/web2py/gluon/dal.py", line 5502, in __call__
return self._db(query).select(limitby=(0,1),for_update=for_update).first()
  File "/home/danto/web2py/gluon/dal.py", line 6330, in select
return self.db._adapter.select(self.query,fields,attributes)
  File "/home/danto/web2py/gluon/dal.py", line 1282, in select
rows = response(sql)
  File "/home/danto/web2py/gluon/dal.py", line 1272, in response
self.execute(sql)
  File "/home/danto/web2py/gluon/dal.py", line 1359, in execute
return self.log_execute(*a, **b)
  File "/home/danto/web2py/gluon/dal.py", line 1353, in log_execute
ret = self.cursor.execute(*a, **b)
  File "/usr/lib/python2.7/site-packages/pysqlite2/dbapi2.py", line 66, in convert_timestamp
datepart, timepart = val.split(" ")
ValueError: need more than 1 value to unpack

what am I doing wrong?

kind regards
  



Re: [web2py] Re: problem with request.date and db.table.update_or_insert

2011-12-14 Thread Daniel Aguayo Catalán

Alan Etkin escribió:

datepart,timepart=val.split( )ValueError:need more than1value to unpack

It looks like convert_timestamp() in pysqlite2.dbapi2 is expecting a
date+time object and receives a date, isn't it?
Hi, I forgot to say that the problem exists even if I try to insert a 
request.now value.


If I try to insert a datetime.datetime.now() object the same problem 
doesn't show, but then the 'update_or_insert' function see it as a new 
entry, doing always an insert


Re: [web2py] Re: problem with request.date and db.table.update_or_insert

2011-12-14 Thread Daniel Aguayo Catalán

Daniel Aguayo Catalán escribió:

Alan Etkin escribió:
datepart,timepart=val.split( )ValueError:need more than1value to 
unpack

It looks like convert_timestamp() in pysqlite2.dbapi2 is expecting a
date+time object and receives a date, isn't it?
Hi, I forgot to say that the problem exists even if I try to insert a 
request.now value.


If I try to insert a datetime.datetime.now() object the same problem 
doesn't show, but then the 'update_or_insert' function see it as a new 
entry, doing always an insert
in fact, seems that, as you said, convert_timestamp() is always 
expecting date+time object, not just one of them and update_or_insert 
method uses that for knowing when to update or insert.


seems that I can't rely on this method for update_or_insert only based 
on the date and need to try-except a db.table.update, or there's another 
way?


Re: [web2py] Re: problem with request.date and db.table.update_or_insert

2011-12-14 Thread Daniel Aguayo Catalán

Alan Etkin escribió:

request.date.now() works well in my system (Python 2.6.5, web2py
1.99.3, Linux)
I think you mean request.now.date() (request.date doesn't exist in my 
system, web2py 1.99.3 with python 2.7.2 on gnu/linux too)


Would you post part of the model and controller to see what it does?

of course:


MODEL:

dbi = db_informes.define_table

dbi('historia',
Field('brand_id', 'integer'),
Field('brand_name'),
Field('positivos', 'integer'),
Field('negativos', 'integer'),
Field('nulos', 'integer'),
Field('total_votos',
  compute = lambda v: v['positivos'] + v['negativos'] + v['nulos']
  ),
Field('fecha', 'string')
)



FUNCTION

def historico_brand():
import datetime

#date = datetime.datetime.now() #error1: need more than 1 value to 
unpack

#date = request.now.date() #error1: need more than 1 value to unpack
#date = datetime.datetime.now().date() #error1: need more than 1 
value to unpack
date = str(datetime.datetime.now()) #NO error1, but doesn't update 
(always insert)'


for b in db(db.brand).select(db.brand.id, db.brand.name):

data = db((db.brand.id == b.id)
 (db.address.brand == db.brand.id)
 (db.address.id == db.rec.address)
 (db.rec.id == db.vote_attribute.rec)
  ).select()

t = f = n = 0

for d in data:
if d.vote_attribute.vote == True:
t += 1
elif d.vote_attribute.vote == False:
f += 1
else:
n += 1


db_informes.historia.update_or_insert(
brand_id = b.id,
brand_name = b.name,
positivos = t,
negativos = f,
nulos = n,
fecha = date
)
return True




On 14 dic, 19:43, Daniel Aguayo Catalándaniel.agu...@gmail.com
wrote:

Alan Etkin escribi :  datepart,timepart=val.split( )ValueError:need more 
than1value to unpack

It looks like convert_timestamp() in pysqlite2.dbapi2 is expecting a
date+time object and receives a date, isn't it?

Hi, I forgot to say that the problem exists even if I try to insert a
request.now value.

If I try to insert a datetime.datetime.now() object the same problem
doesn't show, but then the 'update_or_insert' function see it as a new
entry, doing always an insert




Re: [web2py] Re: problem with request.date and db.table.update_or_insert

2011-12-14 Thread Daniel Aguayo Catalán

Alan Etkin escribió:

dbi('historia',
...
  Field('fecha', 'string')
  )

That should be a 'date' field for web2py to handle date information
properly.
I changed that later. I was using the 'date' type originally when the 
issue came up.



  date = str(datetime.datetime.now()) #NO error1, but doesn't update

I cannot reproduce the error in my system (it performs update or
insert with date only values, but I am using the date field type)

A (poor yet somewhat simple to implement) workaround would be storing
datetime objects instead of date but filtering just the y/m/d values
(with computed fields) so comparisons would match with day precision.

I droped and rebuilded the database (well, web2py). now it works.

Thank you very much for you time :)


Re: [web2py] Re: web2py 1.99.3 is OUT

2011-12-10 Thread Daniel Aguayo Catalán

LightDot escribió:


I'm browsing trough the new web page a bit and I can report a glitch:

div class sixteen columns announce gets thrown to the right, so I 
get a horizontal scroll bar even on a 1920px wide screen. Tested on 
linux, Firefox 8 and Opera 11.60 (screenshot attached).


Chromium 15 shows this div centered and no horizontal scroll bars, I 
guess displaying as intended.

I can confirm this.


Re: [web2py] user profile - adding a button

2011-12-10 Thread Daniel Aguayo Catalán

Nik Go escribió:


How do I add a new button in a user's profile page that redirects to 
another view? 
(assuming that you're using the default 'user' function in 'default' 
controller)

...you can edit the view /default/user.html