[web2py:28446] Re: Single application with multiple groups of controllers

2009-08-12 Thread Kacper Krupa
i think you should create dirs in modules and add __init__.py to each one. Then: def load(): if session.project_a == True: from applications.your_app.a.upload import Upload elif session.project_b == True: from applications.your_app.b.upload import Upload u = Upload()

[web2py:29351] @reboot CRON patch

2009-08-25 Thread Kacper Krupa
Hello, Lately i've to use web2py's cron, and @reboot "function" but it didn't work, so I checked it and created patch. Use it if you want. http://paste.pagenoare.net/default/show/136 Regards. --~--~-~--~~~---~--~~ You received this message because you are subscri

[web2py:32860] Re: hg and google

2009-10-14 Thread Kacper Krupa
I would also prefer bitbucket (or even github) instead of Google Code. But the own trac (with hg/git/svn whatever) is the best idea i think. On 14 Paź, 06:09, Thadeus Burgess wrote: > What about hgwebdir or roll our own app > usinghttp://mercurial.selenic.com/wiki/MercurialApiwith our own custo

[web2py:13583] Re: t3 on launchpad, t2 will die

2008-12-15 Thread Kacper Krupa
I agree with ceej, he's right. On 15 Gru, 20:27, ceej wrote: > I understand what you are saying Massimo and Vince, but what I mean is > I just think t2 should be kept separate and maintained as a sort of > plugin and I think vince you proved my point by saying "web2py, T2 and > T3 are quite conf

[web2py:15635] Re: Unable to run web2py in a git workspace

2009-01-31 Thread Kacper Krupa
I wrote small script to repair it. Place file named 'repair.py' in root of web2py and paste the source from here: http://pagenoare.net/paste/default/show/20 It checks and if some directory misses, it'll create it :) On Jan 17, 4:51 am, BigBaaadBob wrote: > I just want to point out, for those wh

[web2py:15649] Re: Unable to run web2py in a git workspace

2009-01-31 Thread Kacper Krupa
anguages', 'private']: > > Thank you. Should should be part of web2py/scripts > > On Jan 31, 6:18 am, Kacper Krupa wrote: > > > I wrote small script to repair it. Place file named 'repair.py' in > > root of web2py and paste the source from >

[web2py:15650] Re: Unable to run web2py in a git workspace

2009-01-31 Thread Kacper Krupa
Yes, and also you can import it and use in gluon/main.py in creating apps. Each run of web2py.py will repair "broken" apps. PS Sorry for double posting. On Jan 31, 10:32 pm, Kacper Krupa wrote: > No problem -http://pagenoare.net/paste/default/show/21:) > > On Jan 31, 5:36 p

[web2py:16152] Re: error when import

2009-02-10 Thread Kacper Krupa
AFAIK you can replace double exception to: except (ValueError, TypeError): ... On 10 Lut, 15:29, mdipierro wrote: > Try replace in sql.py > > def is_integer(x): >     try: >         long(x) >     except ValueError: >         return False >     return True > > with > > def is_integer(x): >  

[web2py:16178] #!/usr/bin/python returns errors

2009-02-11 Thread Kacper Krupa
Hello, #!/usr/bin/python returns errors on my mac. I had to change it to #!/ usr/bin/env python. I think you shoud replace it. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To

[web2py:16182] Re: #!/usr/bin/python returns errors

2009-02-11 Thread Kacper Krupa
s worked on my macs. > > Do you have something weird set in your .bashrc? > > Time for archive and install? > > On Wed, Feb 11, 2009 at 11:11 AM, Kacper Krupa wrote: > > > Hello, > > > #!/usr/bin/python returns errors on my mac. I had to change it t

[web2py:16183] Re: #!/usr/bin/python returns errors

2009-02-11 Thread Kacper Krupa
I've created symbolic link. It works but using /usr/bin/env python is better i think. On 11 Lut, 19:51, Kacper Krupa wrote: > It's 'cos i have another python on /usr/lib/python. When i've added #!/ > usr/bin/env python it choose python from PYTHONPATH. > > On

[web2py:16213] Re: Linking to an anchor within a view

2009-02-12 Thread Kacper Krupa
{{= URL(r=request, c='controller', f='function', args='#arg') }} or {{= URL(r=request, c='controller', f='function', args=['#arg']) }} ? On 12 Lut, 13:52, cjparsons wrote: > I have a page that contains mainly text information in the view > arranged in sections with labels. I've not put it > in

[web2py:16221] Re: Linking to an anchor within a view

2009-02-12 Thread Kacper Krupa
Yes, 'cos afaik this first doesn't work with older web2py. And also i wanted to show that args can be list On 12 Lut, 15:04, mdipierro wrote: > it is the same > > On Feb 12, 7:25 am, Kacper Krupa wrote: > > > {{= URL(r=request, c='controller', f='fu

[web2py:16223] Re: Linking to an anchor within a view

2009-02-12 Thread Kacper Krupa
The only way what i see its: URL(r=request) + "#something" On 12 Lut, 15:46, cjparsons wrote: > On Feb 12, 1:25 pm, Kacper Krupa wrote: > > > {{= URL(r=request, c='controller', f='function', args='#arg') }} > > or > &

[web2py:17989] SQLFORM without commit

2009-03-13 Thread Kacper Krupa
Hello, I've a problem. I want to use SQLFORM and commit it to db manually. I mean create form, send some data, create ready data for db insert, modify this data and at the finish insert it into database. It's possible, or i have to replace the source of web2py? --~--~-~--~~---

[web2py:18227] Re: 20:09: New peak in #web...@freenode : 13 web2py

2009-03-17 Thread Kacper Krupa
On 17 Mar, 21:15, blackthorne wrote: > We are alive! --~--~-~--~~~---~--~~ 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 from th

[web2py:18228] Re: 20:09: New peak in #web...@freenode : 13 web2py

2009-03-17 Thread Kacper Krupa
Yeah! I think 13 people on the channel is success! On 17 Mar, 21:15, blackthorne wrote: > We are alive! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send emai

[web2py:18231] Re: 20:09: New peak in #web...@freenode : 13 web2py

2009-03-17 Thread Kacper Krupa
15! On 17 Mar, 21:21, Francisco Gama wrote: > Now 14! > > On Mar 17, 8:16 pm, Kacper Krupa wrote: > > > Yeah! > > > I think 13 people on the channel is success! > > > On 17 Mar, 21:15, blackthorne wrote: > > > > We are alive! --~--~-~--

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

2009-03-18 Thread Kacper Krupa
http://pagenoare.net/paste/default/show/35 it's a way to do that. i know it's non-pythonic, but i can't do it more "pythonic". On 18 Mar, 09:05, Michal Jursa wrote: > Is it possible to get mime-type of the uploaded object in some web2py > manner? It would be better to work with mime-type then s

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

2009-03-18 Thread Kacper Krupa
yes, but it guesses by file extension :) On 18 Mar, 16:00, AchipA wrote: > Not web2py, but generic python: > > import mimetypes > mimetypes.guess_type(filename) > > On Mar 18, 9:05 am, Michal Jursa wrote: > > > Is it possible to get mime-type of the uploaded object in some web2py > > manner? It

[web2py:18704] one2many field does not work on 1.59

2009-03-28 Thread Kacper Krupa
Hello, I wrote small gallery script, and i'm using one to many relationship. Here is the code: http://paste.pagenoare.net/default/show/62 It worked on 1.58 but on the newset (1.59) not. What is wrong? I still get ValueError: invalid literal for int() with base 10: '|1|2|' error. I seams that web2

[web2py:18708] Re: one2many field does not work on 1.59

2009-03-28 Thread Kacper Krupa
gallery', >     SQLField('name', 'string'), >     SQLField('images', 'string', db.image), > ) > > should be > > db.define_table('gallery', >     SQLField('name', 'string'), >     SQLField('imag

[web2py:18710] Re: one2many field does not work on 1.59

2009-03-28 Thread Kacper Krupa
OK, thanks for fast reply! On Mar 28, 9:13 pm, mdipierro wrote: > It is not better. It is different. It allows many2many without doing a > JOIN and that means it works on the Google App Engine without > overhead. > > Massimo > > On Mar 28, 3:08 pm, Kacper Krupa wrote

[web2py:18788] Re: request for comments

2009-03-30 Thread Kacper Krupa
i also agree On Mar 30, 4:23 pm, Timothy Farrell wrote: > +1 > > > > johann.scheibelho...@easytouch-edv.com wrote: > > agree > > > On Mar 30, 4:10 pm, mdipierro wrote: > > >> Right now if you say: > > >> db.table.field.writable=False > > >> your field will be hidden to both custom forms and app

[web2py:18842] Re: documentation

2009-03-31 Thread Kacper Krupa
In sphinx you could: - get data from docstrings (like epydoc) - write your own instructions/tips using reST and all on one site with (imo) great design. On Mar 31, 2:48 pm, Grahack wrote: > Massimo, could you please detail why Epydoc is limited. I personaly > use it with ReST formatting and fin

[web2py:18967] Re: auth and views?

2009-04-02 Thread Kacper Krupa
3) def login(): return auth.login() # create view "default/login.html" def register(): return auth.register() # create view "default/register.html" etc etc function should returns dict objects (then the templates are loaded afaik). So: def login(): dict(form=auth.login()) etc. On Apr 2, 6:54 am

[web2py:18987] Re: set id of table tags

2009-04-02 Thread Kacper Krupa
SQLFORM(db.table, row, ..., _id="foo") On Apr 2, 7:06 pm, phneoix wrote: > how to get an output from SQLTABLE or crud.select in the following > way. > . > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[web2py:21805] Re: Get the latest web2py trunk in zip format (no need to get the full repository anymore)

2009-05-13 Thread Kacper Krupa
http://bitbucket.org/douglas/web2py/get/tip.zip - it's the newset rev zipped. On May 13, 7:01 pm, mdipierro wrote: > OK let's wait the first week on June. > > Massimo > > On May 13, 11:18 am, Douglas Soares de Andrade > wrote: > > > Em Quarta-feira 13 Maio 2009, às 12:47:19, mdipierro escreveu:

[web2py:21814] Re: selection of local file

2009-05-13 Thread Kacper Krupa
You should try with smaller files and create diff (to check what is added). It seams to be something between uploading <-> saving. On May 13, 9:57 pm, Hans wrote: > web2py 1.61.4 > WinXP Pro SP3 > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit > (Intel)] > > If there is anyt

[web2py:21893] Re: python path in web2py files

2009-05-15 Thread Kacper Krupa
yep, i told about it: http://groups.google.com/group/web2py/browse_thread/thread/71bb1897b47c153f/749923b3c7e7d791?q=#749923b3c7e7d791 On 15 Maj, 10:22, virhilo wrote: > I think the python path in web2py files stould be: > /usr/bin/env python > instead of /usr/bin/python > > I make a patch for

[web2py:21899] Re: custom crud

2009-05-15 Thread Kacper Krupa
before form=crud.create(): db.adres.bedrijf.default = auth.user.bedrijf On 15 Maj, 16:08, annet wrote: > I am working on a custom crud function. > > In my model I have got the following table: > > db.define_table('adres', >     SQLField('bedrijf', db.bedrijf, default='', notnull=True), >     SQL

[web2py:21918] sqlite and threading

2009-05-15 Thread Kacper Krupa
Hi, I've written application which creates another thread and do things inside it. But why i can't use ORM in it? I'm using sqlite3 and i always get: ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 28329984 and this is

[web2py:21944] Re: sqlite and threading

2009-05-16 Thread Kacper Krupa
it make sure you: > - implement a lock mechanism > - do not access the db object after the thread that created the object > has returned (because the connection is automatically close and > transaction committed). > > Massimo > > On May 15, 11:22 am, Kacper Krupa wrote: > &g

[web2py:22013] lighttpd and trunk

2009-05-17 Thread Kacper Krupa
Hi, Previous versions works well on lighttpd, but when i'm trying to start app on trunk /latest version i've got strange errors. First: AttributeError: 'translator' object has no attribute 'accepted_language' So i removed T.accepted_language from header from layout.html - it works. Next i've:

[web2py:22034] Re: lighttpd and trunk

2009-05-17 Thread Kacper Krupa
Wrr, i had to remove sock. I thought it was done when i restart lighty. Thanks. On 17 Maj, 19:15, mdipierro wrote: > It looks like you updated the applications but not the gluon folder. > > Massimo > > On May 17, 3:54 am, Kacper Krupa wrote: > > > Hi, > > >

[web2py:22410] Re: Update and delete

2009-05-22 Thread Kacper Krupa
if not len(record): or: query=db(db.adres.id==record_id) if query.count() == 0: and then: row = query.select(field)[0] On 22 Maj, 11:45, annet wrote: > I have my authentication, authorization, create and read functions > working, however, I don't get update and delete function to function > w

[web2py:22416] Re: Update and delete

2009-05-22 Thread Kacper Krupa
Yes, sorry - i've checked. I always used len(). On 22 Maj, 19:28, mdipierro wrote: > I repeat > > if not record: > > On May 22, 12:22 pm, Kacper Krupa wrote: > > > if not len(record): > > > or: > > > query=db(db.adres.id==record_id) &

[web2py:22469] Re: Update and delete

2009-05-23 Thread Kacper Krupa
if not request.args: return redirect() On 23 Maj, 08:43, annet.verm...@gmail.com wrote: > Massimo, > > After restarting the server if not record: worked. > > However, further down the workflow there is an error ticket issued > when the user clicks the submit button. > > My custom update function:

[web2py:22934] Re: new DAL

2009-05-30 Thread Kacper Krupa
you should allow to use "normal m2o" relations. i mean with another table in db. i know it doesn't work on GAE but users should have choice. On 30 Maj, 08:21, annet.verm...@gmail.com wrote: > Massimo, > > Will it be possible to have a foreign key on a non id field, in case > of a look-up table? >

[web2py:10447] model choice from list

2008-10-19 Thread Kacper Krupa
Hello, I have a problem - i was searching a while and didn't find any good advice. I want to create a choice form in model, but the options are from list. Something like model relations but not to other table -- just to a python list! (Something like choices parametr in Django -> http://docs.djan

[web2py:10452] Re: model choice from list

2008-10-19 Thread Kacper Krupa
phomore','Junior', 'Senior', 'Graduate') > >     db.mytable.myfield.requires=IS_IN_SET(values, labels) > > (if no labels, values are used as labels) > > Massimo > > On Oct 19, 7:09 am, Kacper Krupa <[EMAIL PROTECTED]> wrote: > >