[web2py:18235] Only allowing gif, png or jpeg images for upload?

2009-03-17 Thread TheDude
How would I only allow gif, png or jpeg images to be uploaded? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe

[web2py:18293] Re: Only allowing gif, png or jpeg images for upload?

2009-03-18 Thread TheDude
erro wrote: > > > class IS_GIF: > > >     def __init__(self,em): self.em=em > > >     def __call__(self,value): > > >         if value and value.filename[-4:].lower()!='.gif': > > >             return (value,self.em) > > >         re

[web2py:18703] Re: Pycon 2009 - Important

2009-03-28 Thread TheDude
Let us know how it goes! :) Will there be a summary follow up? :D On Mar 28, 9:27 am, mdipierro wrote: > See you at the web2py booth after Guido's talk today. (free hats) > > Please attend the web2py Dojo tonight at 6pm in the Open Space. > > Massimo > > On Mar 28, 12:00 am, Steve Shepherd wrot

[web2py:18739] Need help with SQLFORMs

2009-03-29 Thread TheDude
Here's the code: http://pastie.org/private/wmow1xkoaov5ium6cgf8w Here's the problem: ok now a new problem let's say im building a mailbox application (not like email like a private messaging system) and int he table mailbox I have account_id (which account its tied to) On the SQLFORM it shows Acc

[web2py:18742] Re: Need help with SQLFORMs

2009-03-29 Thread TheDude
I also would like to avoid running a query within the controller/ function of db(db.account.name==request.post.account_id) because I need this function in several places. :) On Mar 29, 3:19 pm, TheDude wrote: > Here's the code:http://pastie.org/private/wmow1xkoaov5ium6cgf8w > &

[web2py:18750] Re: Need help with SQLFORMs

2009-03-29 Thread TheDude
alidator() > > In the page you may also need this: > > $(document).ready(function() { $('#mailbox_account_id').attr > ('class','string'); }); > > > Hope it makes sense. > > Massimo > > On Mar 29, 2:19 pm, TheDude wrote: > > > Her

[web2py:18753] Re: Getting last item in a query?

2009-03-29 Thread TheDude
Wouldn't last = db().select(db.table.ALL, orderby=~db.table.id, limit= (1,))[0] be better? Since this way only one row is being retrieved and less overhead? On Mar 29, 5:26 pm, mdipierro wrote: > last = db().select(db.table.ALL).as_list()[-1] > > On Mar 29, 3:42 pm, Michael wrote: > > > I wasn'

[web2py:18759] Re: Getting last item in a query?

2009-03-29 Thread TheDude
e the return > > value from insert: > > > last_id =db.table.insert(item="some item") > > > On Mar 30, 2:00 am, TheDude wrote: > > > > Wouldn't last = db().select(db.table.ALL, orderby=~db.table.id, limit= > > > (1,))[0] be better? Since this way on

[web2py:18765] Re: Would this patch be useful?

2009-03-29 Thread TheDude
This certainly breaks the MVC architecture, but it is valuable. I think web2py should be about being able to expand as much as possible without interfering the people who just want a small and easy framework (it can be a small plant or a big tree). I do like the idea of everything going into the s

[web2py:18768] Re: pycon 2009

2009-03-29 Thread TheDude
Excellent! I wish there was a video, but I'm sure someone has it somewhere on the internet. Good work on the dojo, the only thing I was worried about is.. item = db.news_item[request.args[0]] If the request.args[0] tries to call from a non existant SQLRow then it'll throw an error :) Best to app

[web2py:18798] Re: request for comments

2009-03-30 Thread TheDude
Yes! I was disapointed to find out this wasn't the case and had to go back into my db.py models and change it. +1 :) On Mar 30, 11:11 am, AchipA wrote: > +1 > > On Mar 30, 4:37 pm, Kacper Krupa wrote: > > > i also agree > > > On Mar 30, 4:23 pm, Timothy Farrell wrote: > > > > +1 > > > > johann

[web2py:18864] Re: web2py dojo

2009-03-31 Thread TheDude
Massimo, I tried the Dojo everything worked out fine. I didn't take screen shots, but if no one else is up for it I'll do it :P Only one question aboutit though. Why do you use db.Field() for declaring SQL Fields rather than SQLField() within the documentation? This may cause confusion for newbies

[web2py:18889] Re: Greeting and non-DAL usage question

2009-03-31 Thread TheDude
As of right now, we're trying to get some screen shots for the Dojo as of right now and then Massimo will put them up on the website. I plan on doing the screen shots fairly soon, may be even tonight. :) On Mar 31, 11:30 pm, David Niergarth wrote: > Hello, > > I was at the PyCon dojo and got to

[web2py:18891] Re: In cased you missed it

2009-03-31 Thread TheDude
Pagination would be excellent and is a must, I may write a small function that does this exact thing. :) One thing I would like to see, is a nice tutorial on how to provide a search function within your website. Bonus points for using sphinx as the backend :) On Mar 31, 11:29 pm, Yarko Tymciurak

[web2py:18900] Re: In cased you missed it

2009-03-31 Thread TheDude
Yarko, Does that injection still exist? And, we need a web2py 1.6 soon :P On Apr 1, 1:00 am, Vidul Petrov wrote: > Thank you, Massimo. > > One more question - a role can have many groups and vice versa, an > user can belong to many groups and vice versa? > > On Apr 1, 7:16 am, mdipierro wrote:

[web2py:18921] Web2Py Conference

2009-04-01 Thread TheDude
So who's going to it? It's in about 4 hours from now in Boston. I can't believe I drove all the way from South Georgia just for it! For some of those interested/near the area... We will be talking about: * How to develop nearly every single kind of application there is * How to clone Facebook in

[web2py:18925] Writing a Book

2009-04-01 Thread TheDude
(This isn't an April Fool's Joke) So, I've been writing a book for Web2Py, but recently came towards a new direction...we already have a great in-depth book writeen by Massimo so I was wondering... Would you guys be interested in a book for web2py like 250 pages long that goes in-depth? Or, a ni

[web2py:18926] Re: Web2Py Conference

2009-04-01 Thread TheDude
27;s home footage? > > Boring! > > :-D > > > > ceej wrote: > > Someone needs to take a video cam and record it :) > > > On Apr 1, 1:16 pm, TheDude wrote: > > >> So who's going to it? It's in about 4 hours from now in Boston. I > >&

[web2py:18933] Re: Writing a Book

2009-04-01 Thread TheDude
oding wise from 1.59) please let me know. On Apr 1, 3:27 pm, g-man wrote: > Nice! > > One 'role model' you might want to study is Obie Fernandez' "The Rails > Way", which goes deeply into each element of that complex framework... > > On Apr 1, 11:28 am, T

[web2py:18955] auth and views?

2009-04-01 Thread TheDude
I've tried using Web2Py's auth system and then tried creating the following views: user/register.html user/create.html default/user/register.html default/user/create.html auth/create.html auth/register.html None of them worked, how do you allow views for /default/user/ register ? --~--~-~

[web2py:18961] Re: auth and views?

2009-04-01 Thread TheDude
turn auth.register() > > # create view "default/register.html" > > etc etc > > by the way, if you are going to do special stuff, your code will probably be > more explicit / readable w/ (3). > > > > > Massimo > > > On Apr 1, 9:26 pm, The

[web2py:18963] Re: auth and views?

2009-04-01 Thread TheDude
auth.login() > > # create view "default/login.html" > > def register(): return auth.register() > > # create view "default/register.html" > > etc etc > > by the way, if you are going to do special stuff, your code will probably be > more explic

[web2py:18964] Re: auth and views?

2009-04-01 Thread TheDude
Nevermind, I just did Yarko's method and that worked out fine. On Apr 1, 11:44 pm, TheDude wrote: > 3) > def login(): return auth.login() > # create view "default/login.html" > def register(): return auth.register() > # create view "default/register.html"

[web2py:18965] DAL problem

2009-04-01 Thread TheDude
def index(): rows = (db.mb_posts.board_id==db.mb_boards.id)& (db.mb_posts.reply_to==0) rows2 = (db.mb_posts.board_id==db.mb_boards.id) mb_posts2 = db.mb_posts.with_alias("mb_posts2") query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(), db.mb_posts2.id.count(), left=(db.mb_

[web2py:18990] Re: DAL problem

2009-04-02 Thread TheDude
posts.id.count(), > db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on > (rows2)), groupby=db.mb_boards.id) >     return dict(query=query) > > On Apr 1, 11:13 pm, TheDude wrote: > > > def index(): > >     rows = (db.mb_posts.board_id==db.mb_boards

[web2py:18992] Re: DAL problem

2009-04-02 Thread TheDude
uery = db().select(db.mb_boards.ALL, db.mb_posts.id.count(), > > db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on > > (rows2)), groupby=db.mb_boards.id) > >     return dict(query=query) > > > On Apr 1, 11:13 pm, TheDude wrote: > > > > def ind

[web2py:18996] Re: DAL problem

2009-04-02 Thread TheDude
.mb_boards.mb_posts.count()}} {{=board.mb_boards.keys()}} {{pass}} On Apr 2, 6:38 pm, mdipierro wrote: > what is "board"? > > On Apr 2, 5:20 pm, TheDude wrote: > > > SQL Works! However... > > > {{=board.mb_boards.keys()}} > > brings up: > > ['update_recor

[web2py:19008] Re: DAL problem

2009-04-03 Thread TheDude
So, any suggestions? On Apr 2, 6:42 pm, TheDude wrote: > Sorry, it's in my views :) > > {{extend 'layout.html'}} > Message Boards > class="data"> > > Board > Threads > Posts > Last Topic > > {{for board in query:}} >

[web2py:19012] Re: Writing a Book

2009-04-03 Thread TheDude
ind that applying a solution helps my understanding of > the programming concept, which comes later. > > One thing I've noticed is that the programming community assumes I > know much more about programming concepts than I actually do.  Having > examples with links to elaborat

[web2py:19020] Re: DAL problem

2009-04-03 Thread TheDude
0 0 4 Off-Topic Not everythin...0 0 On Apr 3, 10:34 am, mdipierro wrote: > try: > {{=board.mb_boards.keys()}} > {{=board._extra}} > > On Apr 2, 5:20 pm, TheDude wrote: > > > SQL Works! However... > > > {{=board.mb_boards.keys()}

[web2py:19024] Re: DAL problem

2009-04-03 Thread TheDude
e to do things this way (it doesn't seem like a framework way more like a quick hack). Will there be any modifications within this area in 1.6? On Apr 3, 11:55 am, mdipierro wrote: > {{=board._extra[mb_posts2.id.count()]}} ? > > On Apr 3, 10:01 am, TheDude wrote: > > > RIg

[web2py:19031] Re: DAL problem

2009-04-03 Thread TheDude
_posts2.id.count()}} should be > 'COUNT(mb_posts2.id)'. > > The rationale is that rows=db(...).select > (table.field,table.field.aggregate()) > > table field goes in rows[i].table.field > while aggregates are not fields so they go in rows[i]._extra > [table.field

[web2py:19087] Sub query not registering accurately?

2009-04-04 Thread TheDude
Tried using this as logging tool: http://mdp.cti.depaul.edu/AlterEgo/default/show/194 But it didn't record where I have the problem at all (even after my patches). The controller: def view(): #try: board = db(db.mb_boards.id==request.args[0]).select()[0] rows = (db.auth_user.

[web2py:19093] Re: reponse.flash and auth.messages problem

2009-04-04 Thread TheDude
Vidul. Take a look at this page: http://mdp.cti.depaul.edu/examples/default/tools Under "Custom Authentication" On Apr 4, 12:06 pm, Vidul Petrov wrote: > The problem is that the following two lines work fine (are copied in > response.flash), > > auth.messages.logged_out = 'You have been logged

[web2py:19121] Re: Sub query not registering accurately?

2009-04-04 Thread TheDude
Would really like a response to this. =/ On Apr 4, 11:58 am, TheDude wrote: > Tried using this as logging > tool:http://mdp.cti.depaul.edu/AlterEgo/default/show/194 > > But it didn't record where I have the problem at all (even after my > patches). > > The controller

[web2py:19124] Re: Sub query not registering accurately?

2009-04-04 Thread TheDude
Steve, can you explain this more please? And the ~ means "DESC" :) On Apr 5, 12:33 am, Steve Shepherd wrote: > Whats the ~ tilde doing in your code? > The other way to do this is return the rows you want and use an object count > and then use a command to return the last object from the list. >

[web2py:19158] Re: Sub query not registering accurately?

2009-04-05 Thread TheDude
Thanks guys :) It's been really bogging down my productivity within the website, but here is the query that I am trying to perform.. SELECT mb_posts.id, mb_posts.title, mb_posts.message, mb_posts.posted_by, mb_posts.date_posted, mb_posts.locked, mb_posts.sticky, mb_posts.last_edited, mb_posts.boa

[web2py:19163] Re: Sub query not registering accurately?

2009-04-05 Thread TheDude
his without having a > > copy of the model and without understanding what this is supposed to > > do. Could you explain what you are trying to do? > > > Is the querly below in SQL the one that "you are trying to perform" or > > the one that you are actually performin

[web2py:19164] Re: Sub query not registering accurately?

2009-04-05 Thread TheDude
; > > Is the querly below in SQL the one that "you are trying to perform" or > > the one that you are actually performing and does not work? > > Is it the output of db(...)._select()? > > > Massimo > > > On Apr 5, 10:47 am, TheDude wrote: > >> T

[web2py:19436] Table already exists, yes I know so SKIP it.

2009-04-07 Thread TheDude
OperationalError: (1050, "Table 'users' already exists") I know it already exists, but I want you to just know about it rather than try to create it all the time. I tried clearing out my /databases folder as well. Any other ideas? --~--~-~--~~~---~--~~ You received

[web2py:19537] Re: Sub query not registering accurately?

2009-04-09 Thread TheDude
=mb_posts.posted_by LEFT JOIN mb_posts AS mb_posts2 ON mb_posts2.reply_to=mb_posts.id WHERE (mb_posts.board_id=1 AND mb_posts.reply_to IS NULL) GROUP BY mb_posts.id; On Apr 5, 12:43 pm, TheDude wrote: > Don't know if the google groups posted this already but lets try > again.. &g

[web2py:19581] Idea

2009-04-10 Thread TheDude
Allow sub-queries to be performed within the DAL. How? This would be a good example. db(db.table.field1==db.tbl2.field2).select(db.tbl2.ALL, db (db.hola.id==db.massimo.the_id)._select(db.hola.ALL)) The db() within a .select() should perform a subquery when selecting like that. The system current

[web2py:19596] Migration Issues

2009-04-11 Thread TheDude
OK, so I had a migration issue with my DB some time ago, the easy fix was migrate=False on all of my tables. I knew this was a bad fix, because it was a short-term solution. I get the error "Table feed already exists" now this is true, so instead of trying to create the table, skip the procedure o

[web2py:19598] Re: Migration Issues

2009-04-11 Thread TheDude
Yup here it is: http://paste.pocoo.org/show/guKnBZMTv6AIOHzjz6zd/ On Apr 11, 3:30 pm, mdipierro wrote: > can you show us the web2py model and the query? > > On Apr 11, 2:23 pm, TheDude wrote: > > > OK, so I had a migration issue with my DB some time ago, the easy fix > &

[web2py:20227] Custom auth_user problem

2009-04-21 Thread TheDude
Traceback (most recent call last): File "/home/daniel/web2py/gluon/restricted.py", line 98, in restricted exec ccode in environment File "/home/daniel/web2py/applications/tapthat/controllers/ default.py", line 13, in File "/home/daniel/web2py/gluon/globals.py", line 75, in self._ca

[web2py:20393] Re: Tip of the day: impersonation

2009-04-23 Thread TheDude
Yes we should :) Also, another class/key that checks of the person is impersonating or not. :D @auth.is_impersonating() returns boolean On Apr 23, 3:07 pm, mdipierro wrote: > If you are using Auth you may want to be able to impersonate a > different user without logout and without resetting all

[web2py:21012] More migration/DAL issues

2009-05-02 Thread TheDude
OperationalError: (1054, "Unknown column 'feed.to_player' in 'on clause'") mysql> show fields from feed; +--+--+--+-+-++ | Field| Type | Null | Key | Default | Extra | +--+--+--+-+-+--

[web2py:21117] Table already exists problem [again]

2009-05-03 Thread TheDude
Massimo, I know that we've talked about this in the past, but here we go again... I'm using the latest web2py, in my applications, I would define tables as usual only to get an SQL error saying the table exists. I tried clearing out my "databases" folder, and the only way to clear out would be to

[web2py:21156] Re: Table already exists problem [again]

2009-05-04 Thread TheDude
ssimo > > > > On May 4, 7:02 am, Hans > > > wrote: > > > > > I'm having a similar problem. Last time I solved it by deleting the > > > > database and setting it up new. With more data it gets a pain. I read > > > > about setting &#

[web2py:21205] Re: Table already exists problem [again]

2009-05-04 Thread TheDude
I'm going to bump this, it's fairly critical since a few peopl seem to be affected by it. On May 4, 11:26 am, TheDude wrote: > Massimo, > Just out of curiosity, how would appending "IF NOT EXIST" to the > create table command for MySQL create more problems? This doe

[web2py:21345] Re: Table already exists problem [again]

2009-05-06 Thread TheDude
Massimo, may I propose a solution here? It would require a lot of work, but if it were done I think it'd destroy the competition of other ORMs :P Anyways, have the ORM/DAL catch any errors presented (not sure if this is possible with GAE). If it *does* catch an error, see which number, have python

[web2py:21396] Re: Table already exists problem [again]

2009-05-07 Thread TheDude
with SELECT * FROM > > pg_catalog.pg_tables, Oracle makes the same magic with SELECT TABLE_NAME > > FROM USER_TABLES etc etc... > > > Michal > > > mdipierro wrote: > > > hmmm. This may be a good idea. Is SHOW standard SQL? I am not sure all > > > bac

[web2py:21977] Re: Feature Request: Pagination

2009-05-16 Thread TheDude
Do those examples use the OFFSET paramter? I'm not sure how this affects Oracle or PGSQL, but in MySQL this could be considered a slow query after having 20,000+ rows and exponentially grows from there (I know pgsql has some start-up cost performing this). May want to keep in mind that a better al

[web2py:22019] Re: Feature Request: Pagination

2009-05-17 Thread TheDude
SQL after 20,000 records, > that's why I suggest my clients to use Oracle after their database > grows. > If you are interested in my pager code  I can post it here, although > it might be written better. > > On May 16, 10:10 pm, TheDude wrote: > > > Do those examples us

[web2py:22058] Re: Hoping to increase my connections to web2py people on linkedIn

2009-05-17 Thread TheDude
People are discussing this in the IRC chat already. Just needs a bit of a push ;) On May 18, 12:07 am, mdipierro wrote: > I have a better idea. A web2py app that provides: > - web pages for developers/contributors/users > - a database of projects (could replace appliances) > - a database of code

[web2py:22061] Re: web2py 1.62.0 posted

2009-05-18 Thread TheDude
Got this on initial startup: Traceback (most recent call last): File "web2py.py", line 20, in gluon.widget.start(cron=True) TypeError: start() takes no arguments (1 given) I re tried, it worked the second time. So, if anyone gets this, well just retry. ;) Im on ubuntu hardy. As for testi

[web2py:22062] Re: web2py 1.62.0 posted

2009-05-18 Thread TheDude
the folder). Hope this helps :) On May 18, 6:22 am, TheDude wrote: > Got this on initial startup: > Traceback (most recent call last): >   File "web2py.py", line 20, in >     gluon.widget.start(cron=True) > TypeError: start() takes no arguments (1 given) > > I re

[web2py:22066] Re: DB information on menu

2009-05-18 Thread TheDude
Why not define it as you would with any table? If it's already within the database, add a migrate=False option :) On May 18, 7:50 am, Tito Garrido wrote: > Hi Folks! Thank you for yours answers! > > In fact what a really want is to get db data from a previously defined > database on db.py. > I h

[web2py:22103] Re: web2py 1.62.0 posted

2009-05-18 Thread TheDude
Massimo, what did you fix? Just the recaptcha? Also, Im using python 2.5 if that helps :) On May 18, 10:57 am, mdipierro wrote: > This is a problem. I fixed and posted 1.62.1. Thanks for letting me > know. > > On May 18, 8:34 am, Vidul Petrov wrote: > > > Although the modules are imported (from

[web2py:22150] Re: another web2py powered

2009-05-19 Thread TheDude
What website is it? On May 19, 4:30 am, Yarko Tymciurak wrote: > This is nonsense - > > None of the contact information or registry about the site or domains is > true - all phone numbers, in registry and on the site itself are > disconnected numbers; no name this is registered under is true;  t

[web2py:22152] Re: how to create index on a database table

2009-05-19 Thread TheDude
Hmm may be we can add an "index=True" option? Even better have something like: db.add_index('table', 'name_index_as', ['field1','field2'], unique=True) It'll add an index with multiple fields, unique=True is obviously optional. However, this may be to much work, and may be focusing ont he actual