[web2py] Re: Web2py in combination with mod_python

2011-02-14 Thread Grezly
No, my host doesn't provide FastCGI access, so i need to use
mod_python.

On Feb 13, 10:08 am, cjrh caleb.hatti...@gmail.com wrote:
 On Feb 13, 12:17 am, Grezly dave.i...@gmail.com wrote:

  I'm trying now for a few days to get web2py working with mod_python
  (on a shared hosting). Because i have no other options of configuring
  apache or anything else.

 The procedure using FastCGI works well.   Does your host provide any
 access FastCGI?


[web2py] Web2py in combination with mod_python

2011-02-12 Thread Grezly
I'm trying now for a few days to get web2py working with mod_python
(on a shared hosting). Because i have no other options of configuring
apache or anything else.

I did find a small tutorial on how to configure web2py with
mod_python. (http://www.web2py.com/AlterEgo/default/show/231).

So far i have the following:
.htaccess
===
SetHandler python-program
PythonHandler web2py_modpython
PythonPath ['/path/to/web2py/public_html/'] + sys.path
PythonDebug On
SetEnv SITE_URL '/welcome'

I've also downloaded the web2py_modpython.py.
At first i had some problems with req.subprocess_env['SITE_URL']  in
web2py_modpython.py but found out that setting the enviroment variable
did solve the problem.
So right now i have set the SITE_URL by hand to 'welcome', which
workes, but only for the application. The static files aren't served.
(I only get the text back, links

I did read something that i have to use mod_rewrite, but can't find
information about this specific for web2py.
Does someone has the basic of web2py working with mod_python/apache?
Did i miss something to set? Or did i misconfigure something?


[web2py] Re: Model with 2 fields were one field is required

2011-02-08 Thread grezly
Thanks Massimo,

The fieldnames are arbitrary, i indeed use different names for it (not
even start(_time) or end(_time) )
What i indeed needed was the onvalidation for a crud.

Cheers

On Feb 7, 3:43 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 first of all start and end and sql keywords you should choose another
 name.

 I suggest

 db.define_table('event',Field('title'),Field('start_time'),Field('end_time'))

 def exclusive(form):
     if form.vars.start_time and form.vars.end_time:
         form.errors.end_time = 'you already filled start time')
     elif not form.vars.start_time and not form.vars.end_time:
         form.errors.estart_time = 'you must fill start time or end
 time')

 then use
 form = crud.create(db.event,onvalidation=exclusive)
 and/or
 form = crud.update(db.event,id,onvalidation=exclusive)

 On Feb 7, 6:57 am, grezly d.jan...@foxi.nl wrote:

  i have a table with 3 fields:

  title
  start
  end

  For some reason i want to have the following; the title has to be
  filled in always, but for the start and end field belongs a rule to
  the fields; only 1 of the two fields can be filledin, They also can't
  be either empty or filled in.

  It's up to the user which one of the 2 fields he wants to fill in,
  none of them is more important than the other.


[web2py] Model with 2 fields were one field is required

2011-02-07 Thread grezly
i have a table with 3 fields:

title
start
end

For some reason i want to have the following; the title has to be
filled in always, but for the start and end field belongs a rule to
the fields; only 1 of the two fields can be filledin, They also can't
be either empty or filled in.

It's up to the user which one of the 2 fields he wants to fill in,
none of them is more important than the other.


[web2py] Change upload behaviour: standard filename

2011-01-17 Thread grezly
I'd like to change the default behaviour for one app, concerning my
uploads. Web2py normally rename the uploaded file, but in my
particular case, web2py doesn't need to change my filename.

Is something possible, while creating my model?

Next to that i also like to store a hash of a file in my database.
With the standard crud i can't change this behaviour.
I also can't find such a functionality right now in web2py/crud, or
did i miss something?


[web2py] Multilanguage wiki

2011-01-07 Thread Grezly
I'm trying to create a multilanguage wiki with the plugin_wiki.
I know i can create just a few pages with different slugs
(corresponding to the language) for the same article, but what i can't
figure out is how to create a menu, using meta-menu or another way,
that belongs to a specific language.