Re: [TurboGears] Re: elixir with turbogears2

2017-05-04 Thread Tamas Hegedus

Hi,

I did it 1-2 years ago...
I think that I also made quickstart without sqlalchemy support.
I think that sqlalchemy is always a separate thing and in your 
model/__init__.py:

from sqlalchemy.orm import scoped_session, sessionmaker

I am not an expert, but I think that scoped_session and sessionmaker are 
sqlalchemy objects and Elixir just references them. Elixir just makes a 
wrapping around sqlalchemy to have a simpler syntax.


Tamas

On 05/04/2017 06:27 PM, D R Dinesh Kumar wrote:

Hi Tamas,

Thanks a lot for the details reply.
Should I quickstart the project with "sqlalchemy support" for this?
Since  quickstart, by default enables tg's sqla in my application, I had
to quickstart without sqla and use the elixir.sqlalchemy in my
application (explicitly installing sqlachemy and elixir).
so the scoped_session and sessionmaker both are derived from
elixir.sqlalchemy but not tg.sqlalchemy. Is this the right scenario?
because, tg's session/metadata is not used here too. Please correct me
what am I missing here.


Regarding moving out of Elixir, there is a lot of code already built on
top of Elixir. Not sure how difficult to move this to sqlalchemy. But
surely we need to give it a try. This point from you, is really helpful.

With Regards,
Dinesh.

On Wednesday, 3 May 2017 23:51:56 UTC-7, D R Dinesh Kumar wrote:

Hi All,

We were using Elixir with TG1 and we have recently migrated to TG2.
Finding difficulty in hooking the TG2 session to Elixir session and
metadata.

we were using the following statement in TG1 for the hook:
from turbogears.database import metadata as __metadata__
from elixir import sqlalchemy
__metadata__ = sqlalchemy.MetaData()
__engine__ = sqlalchemy.create_engine("...')
__metadata__.engine = __engine__
setup_all()
create_all()

The above code was doing very good and didnt find any issues at all.

Can you please help how to do the same in TG2? turbogears.database
is not available anymore.

With Regards,
Dinesh.

--
You received this message because you are subscribed to the Google
Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to turbogears+unsubscr...@googlegroups.com
.
To post to this group, send email to turbogears@googlegroups.com
.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] elixir with turbogears2

2017-05-04 Thread Tamas Hegedus

Hi,

1. I think that you should check the documentation of TG2.
And check out your model/__init__.py
Something like that should work:
maker = sessionmaker(autoflush=False, autocommit=False,
 extension=ZopeTransactionExtension())
DBSession = scoped_session(maker)
DeclarativeBase = declarative_base()
metadata = DeclarativeBase.metadata
import elixir
elixir.session = DBSession
elixir.metadata = metadata
def init_model(engine):
"""Call me before using any of the tables or classes in the model."""
DBSession.configure(bind=engine)
from yourproject.model.Entities import *
elixir.setup_all()

2. You will (are predicted to) run into a problem with a newer version 
of SQLAlchemy. Some classes are defined somewhere else than in earlier 
versions. Thus the last version of Elixir can not import that class from 
SQLalchemy. You should change that in the source of Elixir (to set the 
correct "path" (import statement) to that class). I do not find it now 
and can not remember. If this happens and you are at that step and can 
not solve, let me know.


3. I have been a big fun of Elixir. However, I think that it is not 
developed actively. In addition SQLAlchemy has developed a lot in the 
last 10 years. So try to get rid of Elixir and use pure SQLAlchemy.


Bests,
Tamas

On 05/04/2017 08:51 AM, D R Dinesh Kumar wrote:

Hi All,

We were using Elixir with TG1 and we have recently migrated to TG2.
Finding difficulty in hooking the TG2 session to Elixir session and
metadata.

we were using the following statement in TG1 for the hook:
from turbogears.database import metadata as __metadata__
from elixir import sqlalchemy
__metadata__ = sqlalchemy.MetaData()
__engine__ = sqlalchemy.create_engine("...')
__metadata__.engine = __engine__
setup_all()
create_all()

The above code was doing very good and didnt find any issues at all.

Can you please help how to do the same in TG2? turbogears.database is
not available anymore.

With Regards,
Dinesh.

--
You received this message because you are subscribed to the Google
Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to turbogears+unsubscr...@googlegroups.com
.
To post to this group, send email to turbogears@googlegroups.com
.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


[TurboGears] TG 2.3.4 to 2.3.7

2016-01-15 Thread Tamas Hegedus

Hi,

I am trying to upgrade TG 2.3.4 to 2.3.7
I ran into (at least) two problems below I can not solve.
Could you also point out what I could check to solve similar problems?

-
1. Now in my root controller the session seems to be None:

class RootController(BaseController):
secc  = SecureController()
error = ErrorController()
madmin= AdminController()
myprofile  = MyProfile()

session['role'] = ''
session.save()

@expose('mutdb23.templates.index')
def index(self) etc...

File "/home/hegedus/tg23/mutdb23/mutdb23/controllers/root.py", line 79, 
in RootController session['role'] = ''
File 
"/home/hegedus/tg23/lib/python2.7/site-packages/tg/support/objectproxy.py", 
line 31, in __setitem__ self._current_obj()[key] = value

TypeError: 'NoneType' object does not support item assignment

-
2. Although the docs of "url()" says the same in the two versions:

redirect(url('/login', came_from=came_from, __logins=login_counter))
TypeError: url() got an unexpected keyword argument 'came_from'

-
Thanks for your help and suggestions,
Tamas

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] TG 2.3.4 to 2.3.7

2016-01-15 Thread Tamas Hegedus

I meant "upgrade": upgrade my application's code

On 01/15/2016 07:15 PM, Alessandro Molina wrote:



On Fri, Jan 15, 2016 at 2:48 PM, Tamas Hegedus <biohege...@gmail.com
<mailto:biohege...@gmail.com>> wrote:

Hi,

I am trying to upgrade TG 2.3.4 to 2.3.7
I ran into (at least) two problems below I can not solve.
Could you also point out what I could check to solve similar problems?

-
1. Now in my root controller the session seems to be None:

class RootController(BaseController):
 secc  = SecureController()
 error = ErrorController()
 madmin= AdminController()
 myprofile  = MyProfile()

 session['role'] = ''
 session.save()

 @expose('mutdb23.templates.index')
 def index(self) etc...

File "/home/hegedus/tg23/mutdb23/mutdb23/controllers/root.py", line
79, in RootController session['role'] = ''
File
"/home/hegedus/tg23/lib/python2.7/site-packages/tg/support/objectproxy.py",
line 31, in __setitem__ self._current_obj()[key] = value
TypeError: 'NoneType' object does not support item assignment


This should be covered by:

http://turbogears.readthedocs.org/en/latest/cookbook/upgrading.html#session-and-cache-middlewares-replaced-by-application-wrappers

You are problably missing the session.enabled = True option in app_cfg.py

-
2. Although the docs of "url()" says the same in the two versions:

redirect(url('/login', came_from=came_from, __logins=login_counter))
TypeError: url() got an unexpected keyword argument 'came_from'


Passing arguments directly to tg.url was deprecated since TG2.1 but got
removed in 2.2, it's odd that you have been able to use it so far.
see
http://turbogears.readthedocs.org/en/latest/cookbook/upgrading.html#deprecations-now-removed

You should now be passing params=dict() argumt to url.

Also pay attention that redirect+url is actually broken, you would be
applying the SCRIPT_NAME twice, the tg.redirect function supports params
argument directly
http://turbogears.readthedocs.org/en/latest/reference/classes.html#tg.controllers.util.redirect


--
You received this message because you are subscribed to the Google
Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to turbogears+unsubscr...@googlegroups.com
<mailto:turbogears+unsubscr...@googlegroups.com>.
To post to this group, send email to turbogears@googlegroups.com
<mailto:turbogears@googlegroups.com>.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] TG 2.3.4 to 2.3.7

2016-01-15 Thread Tamas Hegedus

Thanks for the prompt answers.

I am developing my application further therefore I installed 2.3.7 on my 
local computer. When I faced these problems, last afternoon I also 
installed a 2.3.4 version which exhibit the same messages as 2.3.7, as 
you expect.


I simply think that I do now a real upgrade to 2.3.x :-)

Have a nice day, Tamas

On 01/15/2016 07:15 PM, Alessandro Molina wrote:



On Fri, Jan 15, 2016 at 2:48 PM, Tamas Hegedus <biohege...@gmail.com
<mailto:biohege...@gmail.com>> wrote:

Hi,

I am trying to upgrade TG 2.3.4 to 2.3.7
I ran into (at least) two problems below I can not solve.
Could you also point out what I could check to solve similar problems?

-
1. Now in my root controller the session seems to be None:

class RootController(BaseController):
 secc  = SecureController()
 error = ErrorController()
 madmin= AdminController()
 myprofile  = MyProfile()

 session['role'] = ''
 session.save()

 @expose('mutdb23.templates.index')
 def index(self) etc...

File "/home/hegedus/tg23/mutdb23/mutdb23/controllers/root.py", line
79, in RootController session['role'] = ''
File
"/home/hegedus/tg23/lib/python2.7/site-packages/tg/support/objectproxy.py",
line 31, in __setitem__ self._current_obj()[key] = value
TypeError: 'NoneType' object does not support item assignment


This should be covered by:

http://turbogears.readthedocs.org/en/latest/cookbook/upgrading.html#session-and-cache-middlewares-replaced-by-application-wrappers

You are problably missing the session.enabled = True option in app_cfg.py

-
2. Although the docs of "url()" says the same in the two versions:

redirect(url('/login', came_from=came_from, __logins=login_counter))
TypeError: url() got an unexpected keyword argument 'came_from'


Passing arguments directly to tg.url was deprecated since TG2.1 but got
removed in 2.2, it's odd that you have been able to use it so far.
see
http://turbogears.readthedocs.org/en/latest/cookbook/upgrading.html#deprecations-now-removed

You should now be passing params=dict() argumt to url.

Also pay attention that redirect+url is actually broken, you would be
applying the SCRIPT_NAME twice, the tg.redirect function supports params
argument directly
http://turbogears.readthedocs.org/en/latest/reference/classes.html#tg.controllers.util.redirect


--
You received this message because you are subscribed to the Google
Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to turbogears+unsubscr...@googlegroups.com
<mailto:turbogears+unsubscr...@googlegroups.com>.
To post to this group, send email to turbogears@googlegroups.com
<mailto:turbogears@googlegroups.com>.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] Re: apache - ssl - url problem

2015-01-14 Thread Tamas Hegedus

Dear Stuart,

Thanks a lot! It seems to work with nginx (it is pretty easy to 
quick-configure and try; especially based on your config file.




On 01/14/2015 06:47 PM, Stuart Zurcher wrote:

Tamas,
If you can use nginx, you can use the following as an example config for
a TG app. I only provide https for redirects to confidential pages in
the following example (ie. login and myprofile).


proxy_cache_path /etc/nginx/data/cache keys_zone=one:10m
  loader_threshold=300 loader_files=200
  max_size=200m;


  server {
 listen 80;
 listen [::]:80 default ipv6only=on;
 proxy_cache one;

 # change to for production/dev
 server_name myinternaldomain.com;


 location / {
 proxy_cache_min_uses 3;
 proxy_set_headerHost $host;
 proxy_set_headerX-Real-IP $remote_addr;
 proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_headerX-Forwarded-Proto $scheme;

 proxy_pass http://localhost:8081;
 proxy_read_timeout  190;
 proxy_redirect  http://localhost:8081 http://$server_name;
 allow all;

 }

 location /css/ {
 alias /opt/Projectname/projectname/public/css/;
 try_files $uri =404;
 }
 location /javascript/ {
 alias /opt/Projectname/projectname/public/javascript/;
 try_files $uri =404;
 }
 location /images/ {
 alias /opt/Projectname/projectname/public/images/;
 try_files $uri =404;
 }
 location /login {
 return 301 https://$host$request_uri;
 }
 location /myprofile/ {
 return 301 https://$host$request_uri;
 }
  }
# statements for each of your virtual hosts to this file

server {
 listen 443;
 listen [::]:443 default ipv6only=on;

 server_name myinternal.domain.com;

 ssl_certificate/etc/nginx/cert.crt;
 ssl_certificate_key/etc/nginx/cert.key;
 ssl on;
 ssl_session_cache  builtin:1000  shared:SSL:10m;
 ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
 ssl_ciphers
HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
 ssl_prefer_server_ciphers on;

 access_log /var/log/nginx/access.log;
 error_log /var/log/nginx/error.log crit;

 location / {
 return 301 http://$host$request_uri;
 }

 location /login {
 proxy_set_headerHost $host;
 proxy_set_headerX-Real-IP $remote_addr;
 proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_headerX-Forwarded-Proto $scheme;

 proxy_pass http://localhost:;
 proxy_read_timeout  90;
 proxy_redirect  http://localhost: https://$server_name;
 allow all;
 }


 location /myprofile/ {
 proxy_set_headerHost $host;
 proxy_set_headerX-Real-IP $remote_addr;
 proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_headerX-Forwarded-Proto $scheme;

 proxy_pass http://localhost:;
 proxy_read_timeout  90;
 proxy_redirect  http://localhost: https://$server_name;
 allow all;
 }

 location /css/ {
 alias /opt/Projectname/projectname/public/css/;
 try_files $uri =404;
 }
 location /javascript/ {
 alias /opt/Projectname/projectname/public/javascript/;
 try_files $uri =404;
 }
 location /images/ {
 alias /opt/Projectname/projectname/public/images/;
 try_files $uri =404;
 }
 location /uploads/ {
 alias /opt/Projectname/projectname/public/uploads/;
 try_files $uri =404;
 }

}


--
You received this message because you are subscribed to the Google
Groups TurboGears group.
To unsubscribe from this group and stop receiving emails from it, send
an email to turbogears+unsubscr...@googlegroups.com
mailto:turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com
mailto:turbogears@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] apache - ssl - url problem

2015-01-14 Thread Tamas Hegedus

Thanks for the suggestion - it does not solve the problem.

On 01/14/2015 05:01 AM, Matthew Cahn wrote:

Hi Tamas,

Try putting a ProxyPassReverse directive after your ProxyPass directive,
like so:

ProxyPass / http://localhost:/
ProxyPassReverse / http://localhost:/

According to the Apache docs --
http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxy ...

This is essential when Apache httpd is used as a reverse proxy (or
gateway) to avoid by-passing the reverse proxy because of HTTP redirects
on the backend servers which stay behind the reverse proxy.

Matthew



On Tue, Jan 13, 2015 at 7:05 PM, Tamas Hegedus biohege...@gmail.com
mailto:biohege...@gmail.com wrote:

Hi,

I just wanted to test if it is my code or not...
I quickstarted a test application placed behind apache with ssl.
root.py - about - redirect to data
It exhibited the same phenomenon:
https://tacml.hegelab.orgdata/

So I think in 2 possibilities:
1. my apache configuration has some problem.
2. TG has a bug

I try to check my apache configuration tomorrow. However, it is
unlikely to be an apache problem, as it works if there is no redirect.
I do not think that I can dig into TG...

Thanks,
Tamas


On 01/13/2015 12:06 PM, Tamas Hegedus wrote:

I am a little bit shy to share my ugly code... :-)

There are 3 fields in my login form. In my pre_login I extract
the 3rd
one (skey) and redirect to login_handler (or back to the login page)

I have an extra question at the end, inserted in my code.

Thanks a lot!

#-__---
# I edited the indents for readability

  def pre_login(self, **kw):

  user_name = kw.get('login',None)
  ERR = False

  # Check the username
  if user_name is None:
  ERR = True
  else:
  try:
  user =

  User.query.filter(User.user___name==user_name).one()
  except sqlalchemy.orm.exc.__NoResultFound:
  ERR = True

  if ERR:
  login_counter =
request.environ.get('repoze.__who.logins',0)+1
  redirect('/login',
params=dict(came_from=kw['__came_from'],
  __logins=login_counter))

  else:
  # Check the skey - this is the 3rd field
  skey = kw.get('skey', None)
  # this is a prestored object with an encrypted
  # property (I (will) know the encryted property only for
  # this object)
  ttaj =
TAJ.query.filter(TAJ.cml_id==__CML0).one()
  ttaj.skey=str(skey)
  # decryption happens, if it is not OK then
  # the skey is not valid; go back to login
  if ttaj.taj != 000111222:
  login_counter =
request.environ.get('repoze.__who.logins',
0) + 1
  redirect('/login',
  params=dict(came_from=kw['__came_from'],
   __logins=login_counter))
  else:
  # extra Q: I would like to store session data in file
  # but I have a key shared by specific user that
  # I do not want to appear in any file on my
server.
  # Is this a good pattern? (At this moment I
could have
  # global skey and not a dict, but for future...)
  global skeyD
  skeyD[user_name] = skey
  redirect('/login_handler', kw)
# here I also tried return HTTPFound

On 01/13/2015 11:49 AM, Moritz Schlarb wrote:

Could you please also share the relevant code from your
mypre_login
function?

Am 13.01.2015 um 11:41 schrieb Tamas Hegedus:

Hi,

I have a TG application running fine as a stand alone
application.
TG: Current: 2.3.4

I place it behind Apache, since I need https.
It works. Some of the pages.
If I try to login then the redirection between the
handlers exhibit an
error: there is no / between the domain name and the
function.

login.html -- action: mypre_login which redirects to
login_handler --
page is not available:
https://tacml.hegelab.__orglogin_handler/
https://tacml.hegelab.orglogin_handler/ in the
browser

[TurboGears] apache - ssl - url problem

2015-01-13 Thread Tamas Hegedus

Hi,

I have a TG application running fine as a stand alone application.
TG: Current: 2.3.4

I place it behind Apache, since I need https.
It works. Some of the pages.
If I try to login then the redirection between the handlers exhibit an 
error: there is no / between the domain name and the function.


login.html -- action: mypre_login which redirects to login_handler -- 
page is not available: https://tacml.hegelab.orglogin_handler/ in the 
browser


I tried to redirect with 'redirect' and 'return HTTPFound'
and got the same result.

I can not decide whether or not this is an error in my apache 
configuration or something with TG. Below is my virtual host file for 
apache.


Thanks for your help in advance,
Tamas

IfModule mod_ssl.c
VirtualHost 195.111.72.57:443
ServerAdmin ta...@hegelab.org
ServerName tacml.hegelab.org
ServerAlias tacml.hegelab.org
DocumentRoot /home//tg23/mutdb23/mutdb23/public

ProxyRequests off
Proxy *
   Order deny,allow
   Allow from all
/Proxy
ProxyPass / http://localhost:/
ProxyPreserveHost on

ErrorLog ${APACHE_LOG_DIR}/tacml-error.log
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

SSLEngine on
SSLCertificateFile/etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

BrowserMatch MSIE [2-6] \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch MSIE [17-9] ssl-unclean-shutdown

/VirtualHost
/IfModule

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] apache - ssl - url problem

2015-01-13 Thread Tamas Hegedus

I am a little bit shy to share my ugly code... :-)

There are 3 fields in my login form. In my pre_login I extract the 3rd 
one (skey) and redirect to login_handler (or back to the login page)


I have an extra question at the end, inserted in my code.

Thanks a lot!

#
# I edited the indents for readability

def pre_login(self, **kw):

user_name = kw.get('login',None)
ERR = False

# Check the username
if user_name is None:
ERR = True
else:
try:
user =
  User.query.filter(User.user_name==user_name).one()
except sqlalchemy.orm.exc.NoResultFound:
ERR = True

if ERR:
login_counter = request.environ.get('repoze.who.logins',0)+1
redirect('/login', params=dict(came_from=kw['came_from'],
__logins=login_counter))

else:
# Check the skey - this is the 3rd field
skey = kw.get('skey', None)
# this is a prestored object with an encrypted
# property (I (will) know the encryted property only for
# this object)
ttaj = TAJ.query.filter(TAJ.cml_id==CML0).one()
ttaj.skey=str(skey)
# decryption happens, if it is not OK then
# the skey is not valid; go back to login
if ttaj.taj != 000111222:
login_counter =
  request.environ.get('repoze.who.logins', 0) + 1
redirect('/login',
params=dict(came_from=kw['came_from'],
 __logins=login_counter))
else:
# extra Q: I would like to store session data in file
# but I have a key shared by specific user that
# I do not want to appear in any file on my server.
# Is this a good pattern? (At this moment I could have
# global skey and not a dict, but for future...)
global skeyD
skeyD[user_name] = skey
redirect('/login_handler', kw)
  # here I also tried return HTTPFound

On 01/13/2015 11:49 AM, Moritz Schlarb wrote:

Could you please also share the relevant code from your mypre_login
function?

Am 13.01.2015 um 11:41 schrieb Tamas Hegedus:

Hi,

I have a TG application running fine as a stand alone application.
TG: Current: 2.3.4

I place it behind Apache, since I need https.
It works. Some of the pages.
If I try to login then the redirection between the handlers exhibit an
error: there is no / between the domain name and the function.

login.html -- action: mypre_login which redirects to login_handler --
page is not available: https://tacml.hegelab.orglogin_handler/ in the
browser

I tried to redirect with 'redirect' and 'return HTTPFound'
and got the same result.

I can not decide whether or not this is an error in my apache
configuration or something with TG. Below is my virtual host file for
apache.

Thanks for your help in advance,
Tamas

IfModule mod_ssl.c
VirtualHost 195.111.72.57:443
 ServerAdmin ta...@hegelab.org
 ServerName tacml.hegelab.org
 ServerAlias tacml.hegelab.org
 DocumentRoot /home//tg23/mutdb23/mutdb23/public

 ProxyRequests off
 Proxy *
Order deny,allow
Allow from all
 /Proxy
 ProxyPass / http://localhost:/
 ProxyPreserveHost on

 ErrorLog ${APACHE_LOG_DIR}/tacml-error.log
 LogLevel debug
 CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

 SSLEngine on
 SSLCertificateFile/etc/ssl/certs/ssl-cert-snakeoil.pem
 SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

 BrowserMatch MSIE [2-6] \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0
 BrowserMatch MSIE [17-9] ssl-unclean-shutdown

/VirtualHost
/IfModule





--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] apache - ssl - url problem

2015-01-13 Thread Tamas Hegedus

Hi,

I just wanted to test if it is my code or not...
I quickstarted a test application placed behind apache with ssl.
root.py - about - redirect to data
It exhibited the same phenomenon:
https://tacml.hegelab.orgdata/

So I think in 2 possibilities:
1. my apache configuration has some problem.
2. TG has a bug

I try to check my apache configuration tomorrow. However, it is unlikely 
to be an apache problem, as it works if there is no redirect.

I do not think that I can dig into TG...

Thanks,
Tamas

On 01/13/2015 12:06 PM, Tamas Hegedus wrote:

I am a little bit shy to share my ugly code... :-)

There are 3 fields in my login form. In my pre_login I extract the 3rd
one (skey) and redirect to login_handler (or back to the login page)

I have an extra question at the end, inserted in my code.

Thanks a lot!

#
# I edited the indents for readability

 def pre_login(self, **kw):

 user_name = kw.get('login',None)
 ERR = False

 # Check the username
 if user_name is None:
 ERR = True
 else:
 try:
 user =
   User.query.filter(User.user_name==user_name).one()
 except sqlalchemy.orm.exc.NoResultFound:
 ERR = True

 if ERR:
 login_counter = request.environ.get('repoze.who.logins',0)+1
 redirect('/login', params=dict(came_from=kw['came_from'],
 __logins=login_counter))

 else:
 # Check the skey - this is the 3rd field
 skey = kw.get('skey', None)
 # this is a prestored object with an encrypted
 # property (I (will) know the encryted property only for
 # this object)
 ttaj = TAJ.query.filter(TAJ.cml_id==CML0).one()
 ttaj.skey=str(skey)
 # decryption happens, if it is not OK then
 # the skey is not valid; go back to login
 if ttaj.taj != 000111222:
 login_counter =
   request.environ.get('repoze.who.logins', 0) + 1
 redirect('/login',
 params=dict(came_from=kw['came_from'],
  __logins=login_counter))
 else:
 # extra Q: I would like to store session data in file
 # but I have a key shared by specific user that
 # I do not want to appear in any file on my server.
 # Is this a good pattern? (At this moment I could have
 # global skey and not a dict, but for future...)
 global skeyD
 skeyD[user_name] = skey
 redirect('/login_handler', kw)
   # here I also tried return HTTPFound

On 01/13/2015 11:49 AM, Moritz Schlarb wrote:

Could you please also share the relevant code from your mypre_login
function?

Am 13.01.2015 um 11:41 schrieb Tamas Hegedus:

Hi,

I have a TG application running fine as a stand alone application.
TG: Current: 2.3.4

I place it behind Apache, since I need https.
It works. Some of the pages.
If I try to login then the redirection between the handlers exhibit an
error: there is no / between the domain name and the function.

login.html -- action: mypre_login which redirects to login_handler --
page is not available: https://tacml.hegelab.orglogin_handler/ in the
browser

I tried to redirect with 'redirect' and 'return HTTPFound'
and got the same result.

I can not decide whether or not this is an error in my apache
configuration or something with TG. Below is my virtual host file for
apache.

Thanks for your help in advance,
Tamas

IfModule mod_ssl.c
VirtualHost 195.111.72.57:443
 ServerAdmin ta...@hegelab.org
 ServerName tacml.hegelab.org
 ServerAlias tacml.hegelab.org
 DocumentRoot /home//tg23/mutdb23/mutdb23/public

 ProxyRequests off
 Proxy *
Order deny,allow
Allow from all
 /Proxy
 ProxyPass / http://localhost:/
 ProxyPreserveHost on

 ErrorLog ${APACHE_LOG_DIR}/tacml-error.log
 LogLevel debug
 CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

 SSLEngine on
 SSLCertificateFile/etc/ssl/certs/ssl-cert-snakeoil.pem
 SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

 BrowserMatch MSIE [2-6] \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0
 BrowserMatch MSIE [17-9] ssl-unclean-shutdown

/VirtualHost
/IfModule





--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] Re: Is there still a tg2 community ?

2015-01-06 Thread Tamas Hegedus

Hi,

Just a connected info for the developers:

I use TG for my professional projects. I selected it because we need an 
easy/clear scripting language, since we are biologists. Thus I would 
like to avoid java or php beside the facts that they are used in a wider 
community and their future is more stable.

TG seems to be the best pythonic framework.

However, regularly (once a year; when starting a new project or 
upgrading our server), I have a stress because of certain TG properties.

* It can change significantly between versions
* It has a lot of dependency that might be difficult to install in an 
older version (older versions of all the matching dependencies; even 
freezing with pip does not solve this problem)
* What is its future? Newer versions, newer options, bug fixes, support, 
etc. Will TG exist in 2, 3, or 5, or 10 years?


Best regards,
Tamas

On 01/06/2015 12:23 PM, Clive Jevons wrote:

Hi Damien,

I'm still reading (although I must admit I skim-read most of the digest
emails). I use TG for my hobby projects, though - so am not overly active :(
Like yourself, I also still consider TG the best of the crop of current
Python web frameworks. Admittedly based on reading through the other
frameworks' docs rather than much hands-on experience with them.
I think with more publicity / evangelising TG could gain more mind-share
and hence also grow a bigger community - I also don't think the problem
is tech related.

Cheers,
C

On Monday, 5 January 2015 18:09:27 UTC+1, lebouquetin wrote:

Hi all,

I worked with turbogears for years, starting in 2008. I always (and
still) feel TG2 is better than other frameworks because :

  * it is full-stack and authentication ready (similarly to django)
  * it is based on existing solutions like babel, sqlalchemy, genshi
/ mako...

For a few month I face a growing frustration :

  * TG2 supports python3 but tgapplications do not
  * I'd like to configure my urls like
(@route('/some/path/to/content/id') which is not available
(except with tgroute which duplicates standard routes)

But the main frustration is from the following points:

  * do not find documentation about what I'd like to do (which is
possible)
  * do not find any help about information I do not find in the
documentation.

There are very few people reading the mailing list and I have
several questions with no reply at all.

As I start again to work on professionnal projects using turbogears,
I was thinking about re-activating the community... but I can't help
because I stay myself without any answer.

What about you ? Who is reading this ML ? Who is still working with
TG ? Is there any reason to still work with it (I know that
Alessandro is doing a great job, this is not my point, but using
open source need a community and I feel like there is no TG2
community anymore).


Damien


--
You received this message because you are subscribed to the Google
Groups TurboGears group.
To unsubscribe from this group and stop receiving emails from it, send
an email to turbogears+unsubscr...@googlegroups.com
mailto:turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com
mailto:turbogears@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] fresh debian / Unable to load template engine entry point: 'json =

2013-06-14 Thread Tamas Hegedus
The only reason was to avoid porting. I have never done and TG is enough 
complex to scare me.


But I had to go with the 2.2... And I am pretty surprised that it is 
relatively easy. Now almost everything is working fine.


Thanks for pushing me towards upgrading :-)
Tamas

On 06/14/2013 09:17 AM, Alessandro Molina wrote:

Uhm, is there any reason why you are installing TG2.0.3? At least up to
2.2 porting should be fairly straight and many bugs have been fixed in
the mean time.


On Fri, Jun 14, 2013 at 1:16 AM, Tamas Hegedus biohege...@gmail.com
mailto:biohege...@gmail.com wrote:

Hi,

I have reinstalled my Debian box to the current stable version.
I try to install TG in a virtual environment. I use the system's
python and the same versions of packages as earlier.

bin/virtualenv --no-site-packages rbcdb
cd rbcdb
source bin/activate


easy_install -i
http://www.turbogears.org/2.0/__downloads/2.0.3/index
http://www.turbogears.org/2.0/downloads/2.0.3/index tg.devtools

wget + unapck + python setup.py install for the following packages:
MySQL-python-1.2.3.tar.gz, SQLAlchemy-0.6.6.tar.gz,
Genshi-0.6.tar.gz, Elixir-0.7.1.tar.gz


paster --help

[...]


/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/Pylons-0.9.7-py2.7.__egg/pylons/configuration.py:__26:
RuntimeWarning: Unable to load template engine entry point: 'json =
turbojson.jsonsupport:__JsonSupport': Traceback (most recent call last)

[...]

AttributeError: 'Label' object has no attribute 'JUMP_IF_FALSE'


I found a proposed solution for this:

You have an old version of PEAK-Rules in your list of packages, and I
guess this causes your problems. You should be able to update it with:

easy_install -U PEAK-Rules

*
However, performing the above update, I run into another error, for
which I could not find any solution.


/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/Pylons-0.9.7-py2.7.__egg/pylons/configuration.py:__26:
RuntimeWarning: Unable to load template engine entry point: 'json =
turbojson.jsonsupport:__JsonSupport': Traceback (most recent call last):
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/Pylons-0.9.7-py2.7.__egg/pylons/templating.py,
line 610, in module
 Engine = entry_point.load()
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/setuptools-0.6c11-__py2.7.egg/pkg_resources.py,
line 1954, in load
 entry = __import__(self.module_name, globals(),globals(),
['__name__'])
   File build/bdist.linux-x86_64/egg/__turbojson/__init__.py, line
1, in module
   File build/bdist.linux-x86_64/egg/__turbojson/jsonsupport.py,
line 3, in module
   File build/bdist.linux-x86_64/egg/__turbojson/jsonify.py, line
6, in module
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/PEAK_Rules-0.5a1.dev___r2713-py2.7.egg/peak/rules/init__.py,
line 3, in module
 from peak.rules.core import abstract, when, before, after,
around, istype, \
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/PEAK_Rules-0.5a1.dev___r2713-py2.7.egg/peak/rules/__core.py,
line 934, in module
 merge_by_default(__AmbiguousMethods)
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/PEAK_Rules-0.5a1.dev___r2713-py2.7.egg/peak/rules/__core.py,
line 558, in _bootstrap
 cache[key] = compile_method(act, self)
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/PEAK_Rules-0.5a1.dev___r2713-py2.7.egg/peak/rules/__core.py,
line 652, in compile_method
 return action.compiled(engine)
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/PEAK_Rules-0.5a1.dev___r2713-py2.7.egg/peak/rules/__core.py,
line 289, in compiled
 body = compile_method(self.body, engine)
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/PEAK_Rules-0.5a1.dev___r2713-py2.7.egg/peak/rules/__core.py,
line 652, in compile_method
 return action.compiled(engine)
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/PEAK_Rules-0.5a1.dev___r2713-py2.7.egg/peak/rules/__core.py,
line 744, in lambda
 engine.apply_template(value___template, self.value),
   File

/home/hegedus/mypy/rbcdb/__local/lib/python2.7/site-__packages/PEAK_Rules-0.5a1.dev___r2713-py2.7.egg/peak/rules/__core.py,
line 466, in apply_template
 tmp = apply_template(template, self.function, *args)
   File build/bdist.linux-x86_64/egg/__peak/util/decorators.py,
line 59, in apply_template
 body =
wrapper.__doc__.replace('%','%__%').replace('$args','%(__argspec)s')
AttributeError: 'NoneType' object has no attribute 'replace'


Do you have any suggestion

[TurboGears] fresh debian / Unable to load template engine entry point: 'json =

2013-06-13 Thread Tamas Hegedus

Hi,

I have reinstalled my Debian box to the current stable version.
I try to install TG in a virtual environment. I use the system's python 
and the same versions of packages as earlier.


bin/virtualenv --no-site-packages rbcdb
cd rbcdb
source bin/activate


easy_install -i http://www.turbogears.org/2.0/downloads/2.0.3/index 
tg.devtools


wget + unapck + python setup.py install for the following packages:
MySQL-python-1.2.3.tar.gz, SQLAlchemy-0.6.6.tar.gz, Genshi-0.6.tar.gz, 
Elixir-0.7.1.tar.gz



paster --help

[...]

/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/Pylons-0.9.7-py2.7.egg/pylons/configuration.py:26: 
RuntimeWarning: Unable to load template engine entry point: 'json = 
turbojson.jsonsupport:JsonSupport': Traceback (most recent call last)


[...]

AttributeError: 'Label' object has no attribute 'JUMP_IF_FALSE'


I found a proposed solution for this:

You have an old version of PEAK-Rules in your list of packages, and I
guess this causes your problems. You should be able to update it with:

easy_install -U PEAK-Rules

*
However, performing the above update, I run into another error, for 
which I could not find any solution.


/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/Pylons-0.9.7-py2.7.egg/pylons/configuration.py:26: 
RuntimeWarning: Unable to load template engine entry point: 'json = 
turbojson.jsonsupport:JsonSupport': Traceback (most recent call last):
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/Pylons-0.9.7-py2.7.egg/pylons/templating.py, 
line 610, in module

Engine = entry_point.load()
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py, 
line 1954, in load

entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File build/bdist.linux-x86_64/egg/turbojson/__init__.py, line 1, in 
module
  File build/bdist.linux-x86_64/egg/turbojson/jsonsupport.py, line 3, 
in module
  File build/bdist.linux-x86_64/egg/turbojson/jsonify.py, line 6, in 
module
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/PEAK_Rules-0.5a1.dev_r2713-py2.7.egg/peak/rules/__init__.py, 
line 3, in module
from peak.rules.core import abstract, when, before, after, around, 
istype, \
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/PEAK_Rules-0.5a1.dev_r2713-py2.7.egg/peak/rules/core.py, 
line 934, in module

merge_by_default(AmbiguousMethods)
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/PEAK_Rules-0.5a1.dev_r2713-py2.7.egg/peak/rules/core.py, 
line 558, in _bootstrap

cache[key] = compile_method(act, self)
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/PEAK_Rules-0.5a1.dev_r2713-py2.7.egg/peak/rules/core.py, 
line 652, in compile_method

return action.compiled(engine)
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/PEAK_Rules-0.5a1.dev_r2713-py2.7.egg/peak/rules/core.py, 
line 289, in compiled

body = compile_method(self.body, engine)
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/PEAK_Rules-0.5a1.dev_r2713-py2.7.egg/peak/rules/core.py, 
line 652, in compile_method

return action.compiled(engine)
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/PEAK_Rules-0.5a1.dev_r2713-py2.7.egg/peak/rules/core.py, 
line 744, in lambda

engine.apply_template(value_template, self.value),
  File 
/home/hegedus/mypy/rbcdb/local/lib/python2.7/site-packages/PEAK_Rules-0.5a1.dev_r2713-py2.7.egg/peak/rules/core.py, 
line 466, in apply_template

tmp = apply_template(template, self.function, *args)
  File build/bdist.linux-x86_64/egg/peak/util/decorators.py, line 59, 
in apply_template

body = wrapper.__doc__.replace('%','%%').replace('$args','%(argspec)s')
AttributeError: 'NoneType' object has no attribute 'replace'


Do you have any suggestion?
Thanks for your help in advance,
Tamas

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/groups/opt_out.




[TurboGears] TG development for money

2013-01-11 Thread Tamas Hegedus

Hi guys,

I have developed a TG application, but I am a biologist and the code is messy...
I do not have time for clean it up and implement 1-2 more features.
We are looking for somebody who could do these for cheap :-)

How much do you think you want for the following to be done?
Please note that we are scientist in Hungary with limited resources.
Please also send some reference, CV.

--
The application is highly similar to this one:
http://slc.bioparadigms.org/
however, somewhat more complex.

I would provide
* the TG project
* data - the mysqldump of the data
   - originally data are imported from 3-4 different places

Major TODOs:

0. Get familiarized with the project.

1. Redesign the object model - I will specify exactly how.
Create the new MySQL database/tables; rewrite the import scripts for the data 
from different resources; repopulate the database.
This would be the cleanest way. However, mapping and moving data from the old 
database to the new one could be also sufficient for now.


2. Implement a form with checkboxes for selecting entries for insertion, 
marked for deletion, deletion depending on user roles.


3. Implement file upload and storage.

Timeline: I think that #0 takes the longest :-) and #1 and #2 are fast. I think 
that it can be done in 2-4 weeks if you do not spend too much time on it. And in 
3-4 days if you spend most of your time with it. If you are smart and an expert :-)


Thanks for your consideration,
Tamas

--
Tamas Hegedus, PhD
Senior Research Fellow
MTA-SE Molecular Biophysics Research Group
Hungarian Academy of Sciences  | phone: (36) 1-459 1500/60233
Semmelweis University  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Tell the community about your application

2012-12-17 Thread Tamas Hegedus

Hi,

We have these sites powered by TurboGears 2:


http://abcmutations.hegelab.org

This got over 600 hits in the first month, in February 2012
and has been published here:
http://www.ncbi.nlm.nih.gov/pubmed/22693078


http://slc.bioparadigms.org

This will be launched in January. When the 2012 review in Molecular Aspects of 
Medicine will be published - this site will be mentioned in the notes of the 
editor of this thematic issue, almost on the first page.




Best regards,
Tamas

Mengu wrote:

hi everybody,

we know that TG has a huge community but we lack the information on
how many great TG applications are out there. let the community know
about your application/s, your TG version and if possible url.





--
Tamas Hegedus, PhD
Senior Research Fellow
MTA-SE Molecular Biophysics Research Group
Hungarian Academy of Sciences  | phone: (36) 1-459 1500/60233
Semmelweis University  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



[TurboGears] InvalidRequestError - authentication

2012-03-27 Thread Tamas Hegedus
._ColumnEntity object at 0x26365d0
view
  raise sa_exc.InvalidRequestError(
   SQL expression, column, or mapped entity 
   expected - got '%r' % column
   )
  expected - got '%r' % column
InvalidRequestError: SQL expression, column, or mapped entity expected - 
got 'class 'rbcdb.model.Mauth.User''



--
Tamas Hegedus, PhD
phone:  (36) 1-459 1500/60233
fax:(36) 1-266 6656
mailto: ta...@hegelab.org
url:http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] InvalidRequestError - authentication

2012-03-27 Thread Tamas Hegedus
If the error happens, I get the same error for pages that do not require 
authentication.

If I clear the cookies in the browser, it start to function again.


It seems that I get this error, if some authentication data have to be
stored in cookies - I am not sure. It happens if some other error
happens, looking the debug page and then try to go back or refresh. Or
if time goes, I leave for a drink (I am not sure of this).


--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] joins - 3 level

2012-01-17 Thread Tamas Hegedus

SQLAlchelmy is also OK for me :-)
Please find the codes and templates below.

Many thanks!
Tamas

***
#
#This version is very slow (10sec)

@expose('myprj.templates.browse')
def browse(self):

q = PfamClan.query
q.enable_eagerloads(True)
pfamclans = 
q.filter(PfamClan.van==1).filter(PfamClan.families.any()).order_by(PfamClan.id).all()

return dict(page='browse', clans=pfamclans)

  !-- The corresponding template --

  py:for each=clan in clans
${clan.longname}br/
ul
  py:for each=fam in clan.families
${fam.longname}br/
  ul
py:for each=prt in fam.protein
  ${prt.entry_name}br/
/py:for
  /ul
  /py:for
/ul
  /py:for

***
#
# This version is fast (1sec)
# .filter(PfamFamily.protein.any()) is an implicit
# join in Elixir (most likely also in SQLAlchemy)

@expose('rbcdb.templates.browse')
def browse(self):

pfamfamilies = 
PfamFamily.query.filter(PfamFamily.protein.any()).all()

return dict(page='browse', families=pfamfamilies)

!-- The corresponding template --

py:for each=fam in families
  ${fam.longname}br/
ul
  py:for each=prt in fam.protein
${prt.entry_name}br/
  /py:for
/ul
/py:for

Michael Pedersen wrote:
I'm not terribly familiar with Elixir, I admit. I'm willing to try to 
help, though. Can you post the model you're actually using (not just 
pseudocode), and (ideally) the template code that works and that doesn't 
work, and I'll try to help sort it out?


On Mon, Jan 16, 2012 at 4:12 PM, Tamas Hegedus biohege...@gmail.com 
mailto:biohege...@gmail.com wrote:


Hi,

I have problems even with simple joins...
I am using TG with MySQL and SQLAlchemy/Elixir.

I have object_TOP with one2many relationship to object_MID with
many2many relationship to object_BOT.

I am doing in the template (pseudo code):
 for oTOP in object_TOP:
print oTOP
for oMID in object_MID:
   print oMID
   for oBOT in object_BOT:
  print oBOT

The rendering in the browser is extremely slow. I mean the fetching
of the objects from the database.

---
There are
500 rows in the table of object_TOP
13,000 rows of object_MID
171 rows of object_BOT

There are only 230 rows in the mapping table of object_MID and
object_BOT (I do not want to delete the unused rows from the table
of object_MID - only if I can not solve this performance issue).

--
To avoid issuing a lot of select statements, I tried eager loading.
q = object_TOP.query()
q.enable_egarloads(True)
It did not help.

If I select only the object_MID and object_BOT in the following way
(performing an implicit join), it works well:
objectMID.query.filter(object___MID.oject_BOT.any()).all()

--
Could you tell me, or at least give me some suggestions, how to do
these things in the proper way? How to do this three level load with
good efficacy?

Thanks a lot for your help in advance,
Tamas

-- 
You received this message because you are subscribed to the Google

Groups TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
mailto:turbogears@googlegroups.com.
To unsubscribe from this group, send email to
turbogears+unsubscribe@__googlegroups.com
mailto:turbogears%2bunsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/__group/turbogears?hl=en
http://groups.google.com/group/turbogears?hl=en.




--
Michael J. Pedersen
My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen
Google Talk: m.peder...@icelus.org mailto:m.peder...@icelus.org 
-- Twitter: pedersentg


--
You received this message because you are subscribed to the Google 
Groups TurboGears group.

To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



--
Tamas Hegedus, PhD
Membrane Research Group| phone: (36) 1-459 1500/60233
Hungarian Academy of Sciences  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



[TurboGears] TG2 in our scientific applications

2012-01-17 Thread Tamas Hegedus

Hi,

In the last months we developed a very simple and a more complex web 
applications using TG2. We plant to publish them soon and also present 
them at a meeting in March.


http://abcmutations.hegelab.org
http://mutfinderpipe.hegelab.org

They are not complete yet (e.g. the second one will be renamed; it can 
not be downloaded yet).


If you have some comments, if you need references differently, please 
let us know.


Thanks for your help provided in the last months :-)

Best regards,
Tamas

--
Tamas Hegedus, PhD
Membrane Research Group| phone: (36) 1-459 1500/60233
Hungarian Academy of Sciences  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



[TurboGears] joins - 3 level

2012-01-16 Thread Tamas Hegedus

Hi,

I have problems even with simple joins...
I am using TG with MySQL and SQLAlchemy/Elixir.

I have object_TOP with one2many relationship to object_MID with 
many2many relationship to object_BOT.


I am doing in the template (pseudo code):
 for oTOP in object_TOP:
 print oTOP
 for oMID in object_MID:
print oMID
for oBOT in object_BOT:
   print oBOT

The rendering in the browser is extremely slow. I mean the fetching of 
the objects from the database.


---
There are
500 rows in the table of object_TOP
13,000 rows of object_MID
171 rows of object_BOT

There are only 230 rows in the mapping table of object_MID and 
object_BOT (I do not want to delete the unused rows from the table of 
object_MID - only if I can not solve this performance issue).


--
To avoid issuing a lot of select statements, I tried eager loading.
q = object_TOP.query()
q.enable_egarloads(True)
It did not help.

If I select only the object_MID and object_BOT in the following way 
(performing an implicit join), it works well:

objectMID.query.filter(object_MID.oject_BOT.any()).all()

--
Could you tell me, or at least give me some suggestions, how to do these 
things in the proper way? How to do this three level load with good 
efficacy?


Thanks a lot for your help in advance,
Tamas

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] controller method return dictionary as post

2011-08-10 Thread Tamas Hegedus

Hi,

I think that something is not clear or clean :-)

The variable in the link is present not because of the return 
dict(...), but because of the submitted form in the previous page, 
which directs to renewpassword_1... The form in the previous page most 
likely have the action=renewpassword_1 and no method=POST is set.


Tamas

David Borsodi wrote:

Hello

I'd like to ask that how can I send the data given in an exposed
controller method as a 'post'.
E.g. if I have this:
@expose('mutdb.templates.renewpassword_1')
def renewpassword_1(self, **kw):
return dict(page='rewnewpassword_1', state=kw.get('state',
'pre'))

I get the following url after execution, what looks like an HTTP GET:
http://localhost:8080/renewpassword_1?state=pre
which is sometimes unacceptable (eg in case of returning an sql
resultset) and usually not elegant.

So, is there any way to post the dictionary ?

thanks
david






--
Tamas Hegedus, PhD
Membrane Research Group| phone: (36) 1-459 1500/60233
Hungarian Academy of Sciences  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] files and sessions

2011-06-05 Thread Tamas Hegedus

Just because. It's TG2 101 - it's just the way you define URL-name-spaces. You 
don't have to, you can put everything into your single root-controller. Which 
will become messy pretty soon. But there is no technical reason not to.

Thanks for pointing out.


So, if you feel more comfortable for now, just put the method in question into 
the root-controller. Or acquaint yourself with the TG2-way of creating 
controller-hierarchies first, with a simple demo-project, to see how things 
work.

I will acquaint myself with the TG2.
This is the simple demo project :-) before a bigger one.


That one is pretty simple: you lack a def methodname(parameters): there.
I just have not thought that it is possible to miss such a line in the 
docs (and even the indentation suggested this).


NiL:
you should correct this at the webpage and in the docs.
Thanks for suggesting to help. At this moment I think that I do it in a 
very simple way, with simple uploads. And later, when I am better in TG, 
I will update to Uploadify.


Thanks!
tamas

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: files and sessions

2011-06-04 Thread Tamas Hegedus

self.add_call(call)

Or I misunderstand something.


That's not an issue, it's a call to a widget-method, and doesn't go through d.

Great!


1. How to define the upload directory? Where to upload the files?
You can define it as you like, most appropriate would be a configuration setting in the *.ini-files. 

Great!
But I do not see the options from the documentation :-)
I will check out the *ini files, but definitely could not find this 
option in Uploadify.



Why would you want that? You so far haven't really told what you are doing, 
maybe it would be better to elaborate.
Sorry, it is so simple that I thought, I was clear. Sometimes I can be 
really unclear and oversimplifying.


Single page simple application:
1. User uploads files
2. S(h)e can remove files (e.g. in the case of clicking to a file that 
was not intended for upload)

3. Pressing the submit button
4. for file in uploaded files: run command file
5. return a link to a single result file
6. delete the files (uploaded and the result files) after 24 hours

I think I just was impatient and the simplest way I can and have to do:
1. To spend more time to figure out how uplodify works
2. To use random file names for storing files and to be able to connect 
a session to a user (file names, link to the result file).

3. Run a script e.g. every hour to delete files older than 24h.

If you have comments, suggestions... welcome. Thanks!

Have a great weekend,
tamas

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: files and sessions

2011-06-04 Thread Tamas Hegedus

Because it has no such option. Uploadify is  a client-side thing. On the 
server-side,
 there is the controller-action which receives the file. It can then 
store it wherever you please.

Yes, I knew that I should learn more :-)

Instead of associating things with the session, associate them with the user. 
Users will not log in for the service. They just come, submit the files, 
 run the calculation and get the results. I will not be able, I do not 
plan to identify the users.


No cpu consumtion, no extremely large files, no need to come back for 
the results 3 days later (the 24h period is just if somebody goes for a 
coffee right after clicking on the submit - a simple solution would be, 
 if somebody loose his/her results, just resubmit the files).


Thanks,
tamas

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] files and sessions

2011-06-04 Thread Tamas Hegedus

Hi guys,

I can not get the Uploadifyer :-(
I still do not get the picture.

I have the followings that seem OK:
1. myproject.template.upload
2. import myproject.model.widgets.uploadfiles import upload_fieldset

I have problem with the controllers and the code handling the uploads.
I guess that the idea is that the file upload should be handled by a 
separate controller. E.g. http:/host/myproject/upload


class UploadController:
...

class RootController
...
upload=UploadController()

---
I do not understand why the upload page is realized at the class-level 
in the UploadController (see the code from the docs below). And why not 
as a function of the UploadController. Or why not as a function of the 
RootController?


I do not understand where the script foobarbaz (that handles the file 
uploads) should be created.
If I define it in the UploadController, I get the No controller-wide 
authorization at  I have the feeling that the file-handling-script 
(foobarbaz) should be defined at the controller level. But what does 
that mean?


---
Moreover, this piece code of UploadController (from the docs) gives an 
error: SyntaxError: invalid syntax (root.py, line 25)

???

class UploadController(BaseController):

@expose('qpcr.templates.upload')
params = { 'child_args' : {   #THIS IS LINE 25
'upload_file': dict(script=foobarbaz),
}
  }
tmpl_context.file_form = upload_fieldset
return dict(params=params)

---

Many thanks in advance!
tamas

Alessandro Molina wrote:

On Fri, Jun 3, 2011 at 4:10 PM, Tamas Hegedus biohege...@gmail.com wrote:

Thanks a lot!

My problem is that you can not store (pickle) file objects in the session
variable.

I could create non-temporary files and store their absolute path.
And remove files after the session expires. Still do not feel that this is
the best (most elegant) solution. :-)



You might store them in a redis value with an expire time.
You would have them accessible from anywhere and they would disappear
after the time you decide freeing up your space.



--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



[TurboGears] files and sessions

2011-06-03 Thread Tamas Hegedus

Hi,

I am developing a TG 2 web application, in which the user can upload 
several files (text files, not huge, but large). Then I run a task with 
each file (command file1, command file2, etc.).


My question: what do you suggest for storing the files while the job is 
submitted by the user?


I could store all the files in the session variable and then write each 
file into a temporary file... But this does not seems an optimal, 
elegant solution for me (I am not a programmer).


Thanks in advance,
Tamas

--
Tamas Hegedus, PhD
Membrane Research Group| phone: (36) 1-459 1500/60233
Hungarian Academy of Sciences  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] files and sessions

2011-06-03 Thread Tamas Hegedus

Thanks a lot!

My problem is that you can not store (pickle) file objects in the 
session variable.


I could create non-temporary files and store their absolute path.
And remove files after the session expires. Still do not feel that this 
is the best (most elegant) solution. :-)



I will check out the tw.uploadify that may work in a way that I simply 
do not have to preserve files between browser requests.


Tamas

Diez B. Roggisch wrote:

On Jun 3, 2011, at 2:27 PM, Tamas Hegedus wrote:


Hi,

I am developing a TG 2 web application, in which the user can upload several 
files (text files, not huge, but large). Then I run a task with each file 
(command file1, command file2, etc.).

My question: what do you suggest for storing the files while the job is 
submitted by the user?

I could store all the files in the session variable and then write each file 
into a temporary file... But this does not seems an optimal, elegant solution 
for me (I am not a programmer).


It depends on your task. If that what you describe above are really 
commandline-tools being invoked, then you should simply create a temp-file. No 
need to store anything in memory, that just blows up the python memory 
footprint without any gain - so forget about session storage.

Diez



--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: files and sessions

2011-06-03 Thread Tamas Hegedus

Dear NIL,

Uploadify would be a nice solution for me. However, I have problems with 
your uploadify:


1. It seems that you still have to instanciate a new object at each 
request - you have self. reference (it seems for me that it is not 
recommended to implement it in a production environment).


2. Docs is far from being trivial for a non-programmer :-) I may put 
some more energy to check it out, but because of #1 I may not.


tamas

NiL wrote:

http://pypi.python.org/pypi/tw.uploadify

might be of end user's help for large files

HTH

NIL



--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: files and sessions

2011-06-03 Thread Tamas Hegedus
I have 1.0a3 that has the same self. in update_params as mentioned by 
Diez at 
http://old.nabble.com/widget-to-upload-a-file-with-progress-bar-td31067880.html



/home/src/tw.uploadify-0.1a3$ less tw/uploadify/widgets.py
...
self.add_call(call)


Or I misunderstand something.


I have other problems, too - I just do not find certain information - I 
might need just spend more time to look it up... But if you know:


1. How to define the upload directory? Where to upload the files?
2. If I want to create a directory with a name corresponding of the 
session ID: I do not find how to get the session id from the beaker 
session system.
3. I do not find enough information about the integration of the session 
system and TG2: how to check if the session expired and files can be 
deleted?


Many thanks,
tamas

PS: these might be trivial, but I did not write any lines of code in the 
last months and my brain needs a few more days to recover :-)


NiL wrote:

what version do you have
1.0a3 only references d, no longer self, this solves #1 :) (I hope)

you can save on disk using tmpfiles...

on the server side, uploadify is view the same as a normal file widget




2. Docs is far from being trivial for a non-programmer :-) I may put
some more energy to check it out, but because of #1 I may not.

tamas








--
Tamas Hegedus, PhD
Membrane Research Group| phone: (36) 1-459 1500/60233
Hungarian Academy of Sciences  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: domain mappin

2011-03-05 Thread Tamas Hegedus
I think you want to use
mod_rewrite of Apache.

Tamas

On Sat, Mar 5, 2011 at 2:21 PM, David Borsodi zellermes...@gmail.com wrote:
 I guess, my question was truly about virtual host mapping.
 If several webapps running on the same server and I want to use
 different domain names for each
 a1.com - a1 app
 a2.com - a2 app


 On Mar 4, 1:16 pm, Diez B. Roggisch de...@web.de wrote:
 Am 04.03.2011 um 12:35 schrieb David Borsodi:

  Hello

  is there any other way to map example.com to 1.2.3.4 for a turbogears/
  paste app than using an apache that handles the domain mapping and
  uses a proxy to forward requests?
  ANY other way, it does not have to be tg/paste specific.

 I don't understand what you are after here. Domain-Mapping is the
 domain (pun intended) of the DNS. Nothing to do with apache.

 The only mildly sensefuly thing I can think of to make from this is
 virtual-host-mapping. Which is a totally different beast. It's about
 having several domains mapped to *one* IP, and thus some
 disambiguation needed when you want to serve several different webapps/
 sites.

 That's usually done by apache, but can also done using nginx. I'm not
 aware of other options, but it wouldn't be hard to write a pure WSGI/
 paster based solution as well. All you need is to discriminate based
 on the HOST-header, and depending on that, dispatche to different
 mounted WSGI apps.

 If that's not what you are after, you need a bit more explaining to do.

 Diez

 --
 You received this message because you are subscribed to the Google Groups 
 TurboGears group.
 To post to this group, send email to turbogears@googlegroups.com.
 To unsubscribe from this group, send email to 
 turbogears+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/turbogears?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: Sand in their Joints - TG and mod_wsgi

2011-01-25 Thread Tamas Hegedus
Don't you think that most of the discussion and opinion of people in the 
last posts make it irrelevant to talk about TG2 and TG3? Maintaining or 
improving TG2 or TG3?


I mean and think that the issue is not whether there is a  maintainer 
for TG2 or not. The issue is: there are no standards/consistent API and 
this is valid for both TG2 and TG3.
Don't you think that there is no sense to do any further coding before 
defining some standards? (I simplify this last sentence, of course)


E.g. I would not worry about TG2 w/o a maintainer if I knew that I can 
continue developing using the current TG2 and I will be able to use TG3 
w/o any extra work or loss of some functionality when TG3 is released.


Bests,
Tamas

Christoph Zwerschke wrote:

Am 25.01.2011 12:48, schrieb Pavel Strashkin:

Hm...i want to ask the main question because i'm a bit confused now.
Who is the maintainer of TG? Who is working on it? Only you?


The official maintainers are Mark Ramm for TG 2.0 and Chris Perkins for
TG 2.1, who have also done the most work on these branches. Michael
Pedersen had cared about the TG 2.1 docs last year. I have taken over
maintenance of the TG 1.x branches (Chris Arndt, Florent Aide and Ken
Kuhlman did that in the past).

Seems Chris and Michael are currently swamped with other duties or
worries and Mark wants to concentrate on TG3, so TG2 currently has no
real maintainer. That's why I say discussions about improving the
stability or docs are moot unless somebody jumps in (or back in) who
really is able to commit some time as the project owner this year.

-- Christoph



--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: setting storage engine

2011-01-21 Thread Tamas Hegedus

or are you guys suggesting that , once the table engine is set to
innodb, that should
take care of the rest of the operations done on the table.?


Yes.

It becomes an inherent property of the table like the number and name 
of columns, or type of a column, or existence of an index on the table.


You define it at the time of creation of the table or with an alter table.

Have a nice day,
tamas

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: Sand in their Joints - TG and mod_wsgi

2011-01-21 Thread Tamas Hegedus

Christoph Zwerschke wrote:

You claim that a framework becomes popular when it's stable, but I'm 
obversing the opposite. As soon as a framework becomes stable, it is 
declared dead, boring, noone blogs about it any more, it does not 


I see this point.

But again, sorry, I am not an IT person and my formulation of sentences...

I do not think that having a stable API means that there is no evolution 
and boiling developing under it.


Popular means: not simply from the development view of developers 
working on the code of the framework, but popular for developers using 
the the framework for their own projects. Yes, I can imagine how boring 
to maintain and advance the code of MySQL or Apache, but it is great, it 
is used, it is popular. And maybe it is not boring either, just the 
preferences/view points of MySQL or Apache developers are different from 
python project developers.



People want XHTML. XHTML is stable. People want HTML5. etc.
Yes, people wanted xhtml, xml. But some of them are just not good 
solution. Remember? Everybody thougth that xml will solve everything. It 
is good for a couple of things, but most of the developers do not like 
it and are better solutions...



WSGI?
Yes. It may work for me - I did not know about it. Again, am not an IT 
person. So please, never forget this if you read something stupid from me.


But it is not what I was talking about. I did not have time to check it 
out yet, but I think it is just standardization of 10 things out of 
1000 I want :-)


Have a good weekend,
tamas

--
Tamas Hegedus, PhD
Membrane Research Group| phone: (36) 1-459 1500/60233
Hungarian Academy of Sciences  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: TurboGears joins the PylonsProject

2011-01-21 Thread Tamas Hegedus

Dear Shivaraj,

I hope you understand the jokes and do not perform any suicide action 
;-) The guys are nice here and very helpful. You just have to formulate 
your question in a way that people understand. I guess you have some 
problem with English. That also happened with me a few years ago - don't 
give up :-)


So be specific.
What type of information do you need?
Why the online documentation is not enough for you?

I few days ago I also experienced some problem finding the online docs.
Today I noticed that first I found the 2.1 docs, but it was not so 
helpful for me as the 2.0 docs. You can find 2.1 docs from the main 
page, while the 2.0 here:

http://turbogears.org/2.0/docs/index.html#documentation-table-of-contents
http://turbogears.org/2.0/docs/toc.html

tamas

Timuçin Kızılay wrote:

21-01-2011 12:42, werner yazmış:

On 21/01/2011 11:27, Diez B. Roggisch wrote:


Am 21.01.2011 um 05:23 schrieb shivaraj sajjan:


I want full information about turbogears


I want cake!

With coffee or tea:-)

Werner



I'm now grinding some good coffee, so you start baking the cake. :-)



--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: Sand in their Joints - TG and mod_wsgi

2011-01-21 Thread Tamas Hegedus



On 1/22/2011 12:00 AM, Alessandro Molina wrote:

Indeed SQLO and Kid were dead technologies and technically each
foundation of TG2 is better, but as TG is a glue framework that puts
together various other projects, it has a really huge risk of having
parts superseded by a new technology.
Since TG is a glue, it can always happen that one of the components will 
dye or a new project of a functional part with superior properties will 
start. Thus you want to replace a given component in TG in the future.


I think, but I don't think I should stress it again :-), the way is not 
to merge with projects and start to maintain them. Just as others told, 
too: create standard wrappers for each components and make them easily 
exchangeable e.g. in the config file *ini. This would be less painful in 
the future for both developers and users of TG.


According to my opinion, later on, when the wrappers, the framework, the 
gluing are working smoothly, there is a rational to merge projects, 
getting involved in developing/maintaining other project's code.



Totally agree, also killing a project for the second time at X.1 (1.1

Please, do not do that :-)
Although I am at an early phase of learning TG before starting the 
development, so I could move to other webframework now without a big 
pane. But I think Django could be the option and I do not want it 
because of the ORM. I think using SqlAlchemy so transparently is a big 
strength of TG.


Best regards,
Tamas

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



[TurboGears] SingleSelectField

2011-01-20 Thread Tamas Hegedus

Hi,

I have a from with a single select field. At the first visit of the page 
the options are in the select field. Other times they are there or not. 
E.g. pressing the submit button with an empty textfield in the form, the 
form is returned, but without selectable values in the select (so the 
select is there, but no options).


Any idea? Thanks!
Tamas

(not the complete code)
-
class BoxForm(TableForm):

type_options = enumerate(('LN','-80C','-20C', '4C', 'RT'))

fields = [
SingleSelectField('type', options=type_options, default='LN', 
validator=NotEmpty),

TextField('name', validator=NotEmpty),
...
]
create_box_form = BoxForm(create_box_form, action=newbox_post)
-
(root.py)
@expose('tgmystorage.templates.newbox')
@authenticate
def newbox(self, **kw):
tmpl_context.create_box_form = create_box_form
return dict()

#**
@authenticate
@validate(create_box_form, error_handler=newbox)
@expose()
def newbox_post(self, **kw):
redirect(url(/browse))

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: Sand in their Joints - TG and mod_wsgi

2011-01-20 Thread Tamas Hegedus

Hi,

I do not think that claiming and complaining are the things to 
discuss. I think it should be evaluated what made other 
projects/frameworks popular and easy-to-use.


My personal opinion is that a bigger (mega) project needs more rules 
compared to a smaller sized project.



I would like to stress (although I am not a progremmer) that being 
standard/consequent/non-changing at the API level is the most important.



There are frameworks/languages where there are a couple of more 
variables in library functions than are used. Variables are even 
reserved (fixed) for future use.


I have not seen a stable python framework. Most likely since it is 
extremely easy to rewrite the code - since Python rocks :-)



I think the ultimate task should be to standardize. Not TG. But the 
components of a framework. OK, and also standards, how to glue the 
components together.


Example #1 if Cherrypy invent a new feature or makes an existing feature 
more stable then I would like replace pylons with charrypy by a changing 
one word in the TG configuration file.


Example #2 in order to try different form solutions, I do not want to 
learn tosca and etc.


-
How to do it?

I think you have the respect to talk to other frameworks (widget, 
database, webserver) and guide the process of creating and implementing 
standards.


A standard may be enough: if somebody does not follow it, will suck.
However, interface objects could be easily implemented (python rocks 
:-)) - however, I think it would be significant overhead - could be 
turned off in a production system.


I know, it would be a big pain for developers to rewrite their codes 
according to a new standard. But this is the short term. On the long 
term it could be extremely benefitial.


-
FYI:
I find not a low risk to build a long term (1 yr) project on it.
I still use it.
Since I like TG :-)

tamas

bvdb wrote:

Hello, it was written:
..  I don't think TG wants to be a framework.  


Of course it wants to be exactly that - look at the Headline on
turbogears.org:
The rapid web developement megaframework

Or does someone claim a megaframework is not a framework?



--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] SingleSelectField

2011-01-20 Thread Tamas Hegedus

Enumerate is a built-in function of python.
I think I used it here, since it was used this way in the tosca tutorial.

I tried a simple list and it works!

Thanks,
tamas

Pavel Strashkin wrote:

Hi Tamas,

What the enumerate? Is it your own type? Try to replace it with list
or tuple and check how it works.

2011/1/20 Tamas Hegedus biohege...@gmail.com:

Hi,

I have a from with a single select field. At the first visit of the page the
options are in the select field. Other times they are there or not. E.g.
pressing the submit button with an empty textfield in the form, the form is
returned, but without selectable values in the select (so the select is
there, but no options).

Any idea? Thanks!
Tamas

(not the complete code)
-
class BoxForm(TableForm):

   type_options = enumerate(('LN','-80C','-20C', '4C', 'RT'))

   fields = [
   SingleSelectField('type', options=type_options, default='LN',
validator=NotEmpty),
   TextField('name', validator=NotEmpty),
   ...
   ]
create_box_form = BoxForm(create_box_form, action=newbox_post)
-
(root.py)
   @expose('tgmystorage.templates.newbox')
   @authenticate
   def newbox(self, **kw):
   tmpl_context.create_box_form = create_box_form
   return dict()

   #**
   @authenticate
   @validate(create_box_form, error_handler=newbox)
   @expose()
   def newbox_post(self, **kw):
   redirect(url(/browse))

--
You received this message because you are subscribed to the Google Groups
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.







--
Tamas Hegedus, PhD
Membrane Research Group| phone: (36) 1-459 1500/60233
Hungarian Academy of Sciences  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



[TurboGears] docs

2011-01-20 Thread Tamas Hegedus

About complains:

A few days ago I was complaining about the TG documentation. Now I see 
it! I like it!


I do not know what was the problem - but I definitely could not find it 
as now. I seems that not all of the links were displayed for me or 
something like that.


:-)

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] setting storage engine

2011-01-20 Thread Tamas Hegedus

You can define the storage engine at the time of creation of a table.
http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html

You can change the storage engine at the run time with an alter table.

You can also define it at table creation in sqlalchemy.
http://www.sqlalchemy.org/docs/07/dialects/mysql.html#storage-engines

So most likely there is a way to do it TG, too. But I do not know it yet.

tamas

rajasekhar911 wrote:

Hi guys,

I am trying to use innodb as storage engine. But i dont want to set
the engine to innodb for all
databases (in my.cnf).

i can set the storage engine at the time of setup-app by executing the
command
set storage_engine='innodb' through the sa_engine. tables were created
with innodb as engine.

how do i set the engine at the run time?
i tried to set it in init_model in __init__.py in model
but it does not seem to work.
also will this effect when TG is initializing connection pool?
or is there any other way i can specify the engine in
development.ini ? or in URL ?

---
thanks





--
Tamas Hegedus, PhD
Membrane Research Group| phone: (36) 1-459 1500/60233
Hungarian Academy of Sciences  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] Re: Sand in their Joints - TG and mod_wsgi

2011-01-18 Thread Tamas Hegedus

Guys!

There are two extremely important thing to get/be popular!

I am a biologist doing some computational work, too. Sometimes we need 
some GUI and (I think) the easiest is to have a web application. We need 
fast and easy development. I prefer python even in websolutions over 
java or php.


However, my problem with most of the python frameworks (not only with 
web-frameworks) that they are not stable. I do not know the right word 
for the thing I want to say. I do not mean that it crashes. I mean that 
there are no interfaces and therefore you can not simply update your 
project, you have to put significant effort to rewrite the code.


I think the popularity would increase if
1. there were some strict rules, interface-like things defined for (TG; 
framework-code) developers
2. there were some better (and more) documentations (better working 
tutorials, accurate user guides and library references) - however I also 
would not put energy in a detailed documentation if the code changes often.


Best regards,
Tamas

Mengu wrote:

no bernd, TG is dead*. long live pyramid_turbogears!

* TG is merging with Pyramid so it will be very different from what it
is now.

On Jan 16, 4:13 pm, bvdb b...@kanka.de wrote:

With a bit of experience in organization I'm always cautious to push
the blame to one aspect alone.
One crucial question might be:
Do TG developers really want the framework to become _popular_ (not
only efficient, powerful or elegant)?

/ Bernd





--
Tamas Hegedus, PhD
Membrane Research Group| phone: (36) 1-459 1500/60233
Hungarian Academy of Sciences  | fax:   (36) 1-266 6656
Tuzolto utca 37-47 | mailto:ta...@hegelab.org
Budapest, 1094, Hungary| http://www.hegelab.org

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.



Re: [TurboGears] variable scope

2011-01-17 Thread Tamas Hegedus

Dear Diez,

for-loops, returning an enumeration, or making one inside the template, 
might be better.


Thanks for your prompt help! Actually, enumaration or iteration is a 
perfect solution for me. I am just not a programmer...


Tamas

--
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.