[TurboGears] TG2.1, sharing DB with TG1.1

2010-03-21 Thread Marco Mariani
Hallo there! I've began exploring TG2.1 today after years of 1.x, and I like it. It would be nice to start writing new modules for an existing business application, currently running under TG1.1. The current app has been in production since 2007, and porting the whole baby is unthinkable.

Re: [TurboGears] Digest for turbogears@googlegroups.com - 14 Messages in 4 Topics

2010-01-29 Thread Marco Mariani
On 01/29/2010 11:23 AM, turbogears+nore...@googlegroups.com wrote: I *think* this is because you need to have the name SQLAlchemy defined in the module you define the handler in. So do you import it in your controller file? This was how it behaved some time

[TurboGears] Re: TG 1.0: How do I rollback database changes after my controller tests?

2009-05-25 Thread Marco Mariani
On May 20, 5:47 pm, Matt Wilson m...@tplus1.com wrote: I like the idea of using a truncate statement with all my tables to wipe out all the rows and then reloading them.  I don't know how to use a rollback with controller tests because cherrypy (or TG) seems to issue a commit at the end of

[TurboGears] Re: TG 1.0: How do I rollback database changes after my controller tests?

2009-05-20 Thread Marco Mariani
On May 20, 12:03 am, Daniel Fetchinson fetchin...@googlemail.com wrote: I don't want to manually wipe out all the entries because it is a hassle to keep updating my teardown method after each new test. So, how can I purge all the data quickly? And how about having a small in-memory

[TurboGears] Re: Using formencode.validators to validate a field as Int and NotEmpty

2009-03-13 Thread Marco Mariani
Julian Yap wrote: Using formencode.validators, I have a field which accepts an Int. I also want it to validate NotEmpty. I sugges you to Read The Formencode Manual Two ways: from formencode.validators import Int, NotEmpty, All validator=Int(min=100, max=999, not_empty=True)

[TurboGears] Re: What are similarities between TG/Django/Rails compared to Zope/J2EE/ASP?

2009-03-10 Thread Marco Mariani
seber...@spawar.navy.mil wrote: TG or Rails or Django have no magic dust, they just make a lot of assumptions (RoR even more) that bigger frameworks don't. What are these assumptions that Zope/J2EE/ASP crowd don't make? Just an example. Coming from zope, I found weird at first

[TurboGears] Re: Passing Parameters to TG Widgets

2009-03-09 Thread Marco Mariani
Michael Pearce wrote: Hi, I have created a WidgetsList object which contains a number of attributes (individual widgets) for creating a database record. I want to use the same WidgetList for editing the database record, however the edit page needs to display additional fields that are

[TurboGears] Re: Standard CRUD (SCRUD)

2009-03-04 Thread Marco Mariani
Sergei Beilin wrote: 1) I wonder if tgext's CrudRestController is close to your specs? 2) I suppose that model/id/action is much better then your's model/ action/id I suppose the REST people have said something about compound primary keys, btw? How would you handle them?

[TurboGears] Re: TG2: UTF-8 doesn't work in ToscaWidgets

2009-02-26 Thread Marco Mariani
ruko wrote: I thought it is sufficient to have the # -*- coding: utf-8 -*- at the top of the file. It seems as if some libraries do not expect unicode. You are mistaking Unicode and UTF-8. A plain string is encoded in UTF8 if you have the # -*- header, but a unicode object is another

[TurboGears] Re: can't start

2009-02-25 Thread Marco Mariani
edgarsmolow wrote: It's too bad that ORMs, whether SA or SO, have limited reflection capabilities. That coerces a one-way methodology: design with the ORM. How is SA's reflection limited? I ask because in my current app (about 150 tables and triggers and stuff) I have never felt

[TurboGears] Re: can't start

2009-02-25 Thread Marco Mariani
Jorge Vargas wrote: For the record that statement was aimed mainly at SO, and it does coerces a structure on your tables which you need to mimic in order to get done. I reckon that. I choose TG over Django for its SQLAlchemy support. Since mine is a management control application (with

[TurboGears] Re: Repeated content and widgets in TG2

2009-02-24 Thread Marco Mariani
Ben Sizer wrote: likely to be fairly static. It's not a big deal either way since I expect the implementation will end up 95% the same whichever route I take, but I'm just trying to get a feel for what value widgets provide over something like py:def and what they don't. Widgets

[TurboGears] Re: Is that possible to map url like this?

2009-02-12 Thread Marco Mariani
Victor wrote: class Controller(tg.Controller): @tg.expose() def admin(self, ...): pass @tg.expose() def post(self, ...) pass @tg.expose() def view(self, ...) pass I want the first directory name be a parameter. Is that possible to

[TurboGears] Re: Is that possible to map url like this?

2009-02-12 Thread Marco Mariani
Victor wrote: @tg.expose() def default(self, name, action, *args, **kwargs): redirect(tg.url('/site', dict(name=name, action=action, **kwargs))) Just a note: redirect() is supposed to be raised, so that you can clearly see there is a disruption of program flow (like with

[TurboGears] Re: Is that possible to map url like this?

2009-02-12 Thread Marco Mariani
Marco Mariani wrote: You can raise cherrypy.InternalRedirect, but it won't change your request parameters: name and action will still be there. Sorry, I'm not sure what I wrote about request parameters, I've seldom used it, try

[TurboGears] TGTest and DBTest, separated at birth?

2009-02-03 Thread Marco Mariani
Hallo there! I'm trying to port my current 2 yrs old project (running on TG 1.0.8 + SA 0.4.8 + postgres) to TG 1.1b3 It's a management control application that relies heavily on SqlAlchemy's autoload feature due to the complexity of the db (150+ tables and views, growing) I really think the

[TurboGears] Re: Formencoding with Floats and German Users :)

2008-12-05 Thread Marco Mariani
Felix Schwarz wrote: I agree completely with that one. In the end I deployed a solution which does not accept '.' for German decimal numbers if they are not used as grouping separator. Do users really enter grouping separators in program forms? Have you seen them in the wild? :)

[TurboGears] Re: WidgetsList inheritance not working as expected

2008-10-16 Thread Marco Mariani
Kirk Strauser wrote: First, how is that even possible? I've never seen a Python class that behaves that way (not meant as a criticism, but genuinely curious). You should look at the WidgetsList implementation, it's not hard. Second, are there idiomatic workarounds? Yes,

[TurboGears] Re: Sanely working with un-normalized legacy tables

2008-10-09 Thread Marco Mariani
Kirk Strauser wrote: So, I basically need to convince TG and SQLAlchemy that customers.groupcode is unique so I can display those values in popups and create a many-to-many table linking users_table to customers. Don't you have another column you can use with groupcode, to uniquely

[TurboGears] Re: Turbo Gears or Django?

2008-07-19 Thread Marco Mariani
Mark Ramm wrote: And really Genshi is very similar to Kid, so that transition is pretty easy. Well... how do I port my TG widgets over to Genshi, in 1.0.5 or 1.5 or whatever? Since I cannot mix TG and Tosca widgets on the same form, I am pretty much forced to port all of the widgets to

[TurboGears] Re: Why two controllers.py files?

2008-07-09 Thread Marco Mariani
[EMAIL PROTECTED] wrote: But since no one has come up with a good reason for having files with the same name (not the same namespace, just the same name), Because sensible, readable names under namespaces are what distinguishes us from COBOL. I standy-by my original assertion that it's an

[TurboGears] Re: Why two controllers.py files?

2008-07-09 Thread Marco Mariani
[EMAIL PROTECTED] wrote: Wait a minute. I've never, ever imported turbogears.controllers. Really? Really. Why should I keep dangling imports? validate, expose(), flash(), redirect(), url() are available through turbogears.__init__ I could swear that the first line of the

[TurboGears] Re: Why two controllers.py files?

2008-07-08 Thread Marco Mariani
Dean Landolt wrote: Having modules with the same basename in different packages is general practice in Python. This sounds like it might be some confusion do to a from turbogears import * Not as confusing as from os import *, where your beloved open() builtin goes down the

[TurboGears] Re: Identity session killed on page refresh

2008-06-17 Thread Marco Mariani
Max wrote: Is there any reason why an Identity session might be reset on a page refresh? Check for the session_id and tg-visit cookies: is one of them missing? Does it only happen on firefox? If the answer is yes, I've seen it twice. I made it work by using the 'max-age' property

[TurboGears] Re: Identity session killed on page refresh

2008-06-17 Thread Marco Mariani
Max wrote: There is no session_id cookie before or after login. Which is fine because the stock identity does not use a session. -- This e-mail (and any attachment(s)) is strictly confidential and for use only by intended recipient(s). Any use, distribution, reproduction or disclosure by

[TurboGears] Re: identity and many groups

2008-06-10 Thread Marco Mariani
Diez B. Roggisch wrote: I see I could add: @identity.require(identity.in_any_group(admin,group2,group3)) I think you should grant a permission to all of those groups, and check the permission directly. That's what permissions are for. Or else, in case things get more hairy,

[TurboGears] Re: identity and many groups

2008-06-10 Thread Marco Mariani
Cecil Westerhof wrote: That will only work when every user is in a group. I think that there is a way to get the group(s) of an user. When the only requirement is that the person is part of a group, you could check that it is not empty. Maybe you mean identity.conditions.in_any_group()

[TurboGears] Re: identity and many groups

2008-06-10 Thread Marco Mariani
Lukasz Szybalski wrote: On Tue, Jun 10, 2008 at 10:05 AM, Cecil Westerhof [EMAIL PROTECTED] wrote: 2008/6/10 Lukasz Szybalski [EMAIL PROTECTED]: I think that there is a way to get the group(s) of an user. When the only requirement is that the person is part of a group, you could

[TurboGears] Re: To not use an ORM

2008-05-28 Thread Marco Mariani
[EMAIL PROTECTED] wrote: make TG happy because it needs an ORM for the identity and permission tables. So I can just SQLAlchemy for the Identity and Permissions stuff and my own for everything else? Yes, and I recommend you looking at the two lower layers of SQLAlchemy, instead

[TurboGears] Re: tg session and sa query how?

2008-05-28 Thread Marco Mariani
Lukasz Szybalski wrote: class th(object): pass How do I do the same query in turbogears? th.query.filter(...).all() As far as I know the session is managed by turbogears? What exactly happens with the session? The session is bound to the mapped classes. It's just one way to

[TurboGears] Re: Jsonify model

2008-04-30 Thread Marco Mariani
Vortexmind wrote: Instead of patching it to add a check for the existence of __json__, I use to comment out support for sqlalchemy in turbojson. I don't want every single column that is stored in the DB to be serialized down to the user's browser. There is, like, security, privacy issues

[TurboGears] Re: Jsonify model

2008-04-30 Thread Marco Mariani
Vortexmind wrote: It's a tradeoff between ease of use and complexity, not so simple. While I'm perfectly fine with the way it is now (I just have to monkey patch turbojson), I think a mixin class (a la zope) or a register_json function could have been equally simple to use. For

[TurboGears] Re: Jsonify model

2008-04-29 Thread Marco Mariani
Vortexmind wrote: If I'm right, this is what I'm talking about ... http://trac.turbogears.org/ticket/1619 Instead of patching it to add a check for the existence of __json__, I use to comment out support for sqlalchemy in turbojson. I don't want every single column that is stored in the

[TurboGears] Monkey patching inspect.py, hope it's safe (was Re: Can the argument of @error_handler be a function?)

2008-04-28 Thread Marco Mariani
Christoph Zwerschke wrote: So the tg_errors argument has been passed correctly and the dummy variable still contains the Root object. This made me believe I need the dummy variable. I don't understand fully what's going on especially because Chris suggested that the dummy variable is not

[TurboGears] Re: Problem with appendChildNodes

2008-04-26 Thread Marco Mariani
But I thought that the use of innerHTML was frowned upon, or is that not the case? There are different opinions. http://www.robertnyman.com/2006/04/20/we-all-love-innerhtml/ The argument is simple enough: - Calling a URL (with proper template and stuff) and inserting that output

[TurboGears] Re: Problem with SingleSelectField and validator

2008-04-24 Thread Marco Mariani
Christoph Zwerschke wrote: validator = validators.NotEmpty) I think you must instantiate validators, i.e. use validators.NotEmpty(). From formencode.declarative: Declarative objects for FormEncode. Declarative objects have a simple protocol: you can use classes in lieu of

[TurboGears] Re: string key word arguments being transformed into dictionary

2008-04-22 Thread Marco Mariani
Diez B. Roggisch wrote: This is the expected behaviour - it is the formencode-parameter-conversion that works that way. And AFAIK that was the same in TG0.9 If you want the original paramters, inspect the cherrpy.request.params. cherrypy.request.params is already nested, at least

[TurboGears] Re: string key word arguments being transformed into dictionary

2008-04-22 Thread Marco Mariani
Marco Mariani wrote: cherrypy.request.params is already nested, at least here. You might want to call variable_decode from FormEncode. Ehr, variable_encode, that is. That's what I do. -- This e-mail (and any attachment(s)) is strictly confidential and for use only by intended

[TurboGears] Re: Importing legacy model from database

2008-04-16 Thread Marco Mariani
Vortexmind wrote: I'm new to Turbogears: I've chosen it because of the supports it provides (with SQLAlchemy) for tables with multiple field primary keys. I have a legacy database to use, and I need to know if there is sort of automatism to import model from legacy database schema, or

[TurboGears] Re: Creating dynamic forms

2008-04-16 Thread Marco Mariani
Diez B. Roggisch wrote: http://docs.turbogears.org/1.0/UnifiedControllers It's quite useful but unfortunately buried in the documentation. OMFG. That's one piece of ugly code. Wait, wait! I am trying to get rid of a similar Piece Of Ugly Code. I feel guilty for having used that,

[TurboGears] Re: Reflection Using SqlAlchemy---Good idea?

2008-04-15 Thread Marco Mariani
shday wrote: Another tid bit. During development, reflection can be a PITA because it can increase application startup time considerably. This can be overcome, however, by pickling your reflected metadata and using that (instead of reflecting every time). My current application reflects

[TurboGears] Re: Ajax without JavaScript?

2008-04-09 Thread Marco Mariani
Diez B. Roggisch wrote: But also (and as you say yourself) it does not rid you of knowing JS. I think the most common reason given (by programmers) for not using javascript is its perceived quirkness and the scarcity of features in the standard library. As one bright Python developer

[TurboGears] Re: Google App Engine!

2008-04-09 Thread Marco Mariani
John M Camara wrote: One thing no one has mentioned so far is that there will be no support for a relational database. I personally think this is a good thing so people can realize that other datastore options are available. It would have been better if the query language didn't have a

[TurboGears] Re: Ajax without JavaScript?

2008-04-08 Thread Marco Mariani
Diez B. Roggisch wrote: In the end, programming is and will always be that - programming. So I'm really having difficulties to imagine that more than rather simple usecases can be covered. Instead, I prefer a lib like MochiKit or jQuery that makes the unavoidable as nice and smooth.

[TurboGears] Re: How to embed HTML inside widget label?

2008-03-28 Thread Marco Mariani
Matt Wilson wrote: Glauco, thanks for the feedback. What keyword do I use to pass this into my TableForm? This doesn't look like a complete template, so I don't think I should pass this in with a template keyword. The code Glauco posted is from the TableForm's template. Look for

[TurboGears] Re: flash() with options? notice and field_error

2008-02-13 Thread Marco Mariani
Christopher Arndt wrote: http://chrisarndt.de/projects/fancyflashexample/ oops. The requested URL /projects/fancyflashexample/FancyFlashExample-1.0-py25.egg was not found on this server. -- This e-mail (and any attachment(s)) is strictly confidential and for use only by intended

[TurboGears] Re: Formetto: widgets in the template, not in the controller

2008-01-30 Thread Marco Mariani
Daniel Fetchinson wrote: I haven't looked at your code yet but have to say that I also don't like very much the fact that I have to define what widgets are used in the controller. It feels more natural to declare this in the template. I don't claim to have a very precise opinion on what

[TurboGears] Re: Using TG to fake being a PHP site

2008-01-25 Thread Marco Mariani
Richard Jones wrote: I'm at a loss how to configure TG to actually have a URL of submit.php. If the problem is the dot, declare the controller as submit_php, it should work AFAIR -- This e-mail (and any attachment(s)) is strictly confidential and for use only by intended recipient(s).

[TurboGears] Re: Suppressing mochikit problems

2008-01-23 Thread Marco Mariani
Diez B. Roggisch wrote: I was expecting the default mochikit file from the TG distribution not be included in the resulting web pages, but it is. I don't see any changes related to the suppress flag. Where should I be able to see the change if the flag is on or off? That's strange.

[TurboGears] Re: cherrypy3

2007-12-20 Thread Marco Mariani
Florent Aide wrote: - Second the communication on where the 1.0 and 1.1 branches are going as been quite feeble (to say the least) and this is my own fault. I'll need to amend my ways. I promise I'll try to find time on new year's eve to communicate more on the planning, the milestones and

[TurboGears] Re: Authentication against an LDAP Server

2007-12-18 Thread Marco Mariani
Frank Slotta wrote: I hope this could be useful, please send suggestions if something is wrong or obsolete. Seems fine, although with the current release you can also point identity.provider to a class path, and it will be loaded with load_class().. This way, there is no need to

[TurboGears] Re: Using Elixir, is there a nice way to specify which columns should be distinct in a select?

2007-12-04 Thread Marco Mariani
Kevin Cole wrote: I don't care how many columns are returned, but I want to tell it which ones should be distinct, and still get the benefits of the mapping. What do you mean which ones should be distinct ? I mean, distinct is not a function (*) What's your use case? (*)

[TurboGears] Re: review of JS libraries

2007-12-03 Thread Marco Mariani
Javier Rojas wrote: I apologize right now if there are any grammar errors or things like that; my mother language isn't english :) There is at least one link error YUI my opionion links to javascript-libraries#my-opinion and it says I hate not having proper documentation.. in

[TurboGears] Re: Embedding python variables as html tag attirbutes

2007-11-14 Thread Marco Mariani
vimal wrote: ?python if usr_rght in user_rights: //usr_rght is an integer and user_rights is a list// add_user = false else: add_user = true ? If you can avoid ? snippers, please do yourself a favour. input type=button value=ADD USER

[TurboGears] Re: problem in specifying href

2007-10-31 Thread Marco Mariani
vimal wrote: script type=text/javascript function onClick() { window.location.href=(/student,{'name':${name},'age':${age}} I guess you need to compose the full URL - and include ${name} in quotes. function queryUri(base, params) { for (var key in params) { if

[TurboGears] Re: Sending formatted HTML to KID

2007-10-08 Thread Marco Mariani
Jason ha scritto: greetings all I know this is going against the MVC structure Come on. If it makes sense to do that, you should :-) but I need to send a sting variable from the controller to kid for display it without it all getting converted in special HTML characters. thanks! You

[TurboGears] Re: Embedding variable data inside an html tag inside a kid template

2007-09-26 Thread Marco Mariani
[EMAIL PROTECTED] ha scritto: print kid.Template('span xmlns:py=http://purl.org/kid/ns#; value=${None} /') ?xml version=1.0 encoding=utf-8? span / But just looking it at I would assume it would suffer from the same problem. I am not sure I understand your concern. No readonly

[TurboGears] Re: Embedding variable data inside an html tag inside a kid template

2007-09-25 Thread Marco Mariani
Kevin Cole ha scritto: input type=text readonly=$readonlyvar/ Wouldn't it be better to make $readonlyvar equal the entire string readonly=readonly That would defeat the whole point of having an XML based template engine. I'm used to that since TAL was introduced in Zope 2,

[TurboGears] Re: Sending headers

2007-09-21 Thread Marco Mariani
Halldór ha scritto: Hi there, How do I send headers with Turbogears (or it's probly Cherrypy)... cherrypy.response.headers['Expires'] = '...' cherrypy.response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0' cherrypy.response.headers['Pragma']

[TurboGears] Re: How do you turn off xhtml strict with turbogears?

2007-09-20 Thread Marco Mariani
Thierry ha scritto: Is there a way to turn off the strict xhtml parsing? From app.cfg: # which view (template engine) to use if one is not specified in the # template name # tg.defaultview = kid # The following kid settings determine the settings used by the kid serializer. # One of

[TurboGears] Re: Registering a global function for templates

2007-09-17 Thread Marco Mariani
exhuma.twn ha scritto: static/icons/theme1/*.png static/icons/theme2/*.png static/icons/theme3/*.png You can register an alieased path in app.cfg: [/themed_icons] static_filter.on = True static_filter.file = %(top_level_dir)s/static/icons/theme1 then you refer to them as

[TurboGears] Re: TGYUI help

2007-09-14 Thread Marco Mariani
The Alchemist ha scritto: I am working with TurboGears 1.0.3.2 and have downloaded TGYUI 0.1.1 I need help to create a widget (say, a grid) using TGYUI, and then seeing it in the browser (through an exposed method in the controller). Is there documentation for using the TGYUI package? Or

[TurboGears] Re: Sharing Widget Fields

2007-09-14 Thread Marco Mariani
krsyoung ha scritto: Is there some way I can make a common_fields subclass that I can then reuse in both of the approver_fields and admin_fields? Basically I want to pull out name so I don't have to repeat it for each widget. WidgetLists are lists, you do not subclass them; you add

[TurboGears] Re: Ajax widget RemoteForm discards multiple selections

2007-09-13 Thread Marco Mariani
jype ha scritto: I _think_ this is MochiKit 1.3.1's fault - the form-value-gathering-thingy isn't working properly. Try switching to MK 1.4, or rip 1.4's form gathering code (don't recall the name right now) and patch that into the RemoteForm. I tried that but it didn't work. I

[TurboGears] Re: Saving Pdf in turbogears

2007-09-11 Thread Marco Mariani
Florent Aide ha scritto: I am trying to make a small TG application, which should save PDF file. It stores letters in a PDF format in a relational database. Do you believe it is a good idea to use a class as below? Any idea welcome. class Letters(Entity):

[TurboGears] Re: TG, Ajax and interactive graphics

2007-08-21 Thread Marco Mariani
Diez B. Roggisch ha scritto: I'm not aware that anti-aliasing is available. There is no way for drawing 2D, let alone 3D unless you use flash or SVG. I'm sure there is a way, and it seems anti-aliased to me: http://www.abrahamjoffe.com.au/ben/canvascape/

[TurboGears] Re: Splitting the Model

2007-08-19 Thread Marco Mariani
Lee Connell ha scritto: That worked but when I put my identity model in its own it broke the identity. If you move the identity classes, you must tell TG the new location in app.cfg or dev.cfg: visit.saprovider.model = myproject.model.Visit identity.saprovider.model.user =

[TurboGears] Re: Splitting the Model

2007-08-17 Thread Marco Mariani
Lee Connell ha scritto: What do you mean, what didn't work for me? Did you try splitting the model? Did it work? Why do I need to move model.py into __init__.py To avoid changing the code in controllers all at once. couldn't I move whatever I had in there into model/new_model.py?

[TurboGears] Re: Improving Kid Template Performance?

2007-08-16 Thread Marco Mariani
iain duncan ha scritto: Thanks, that's good info. What do you guys use to profile on a page by page basis? Aside from python profiling... on the client side, you can try Google's Load Time Analyzer https://addons.mozilla.org/it/firefox/addon/3371

[TurboGears] Re: sqlalchemy with turbogears and mapper

2007-08-16 Thread Marco Mariani
Lukasz Szybalski ha scritto: There is around 20 tables with a lot of foreign key, compound keys and alternative keys. Which mapper do I use? By mapper, do you mean a layer like ActiveMapper or Elixir? I am happy with the autoload feature. No need to declare the tables at all. Actually,

[TurboGears] Re: Splitting the Model

2007-08-16 Thread Marco Mariani
Lee Connell ha scritto: Is there anyway to split my model up? Sure. Move your model.py into model/__init__.py, and add more modules. What didn't work for you? I would like to split each table/entity into it's own class its own module, you mean.

[TurboGears] Re: RepeatingFieldSet and validators..

2007-08-03 Thread Marco Mariani
Glauco ha scritto: Whats the best solution for validate a RepeatingFieldSet? from turbogears.validators import Schema, ForEach, String, Int from turbogears.widgets import WidgetsList, RepeatingFieldSet, TextField Say you have a repetition of class MyFormFields(WidgetsList): stuff =

[TurboGears] Re: modeling hierarchical categories?

2007-08-02 Thread Marco Mariani
Chris Curvey ha scritto: I can't believe this is not a FAQ, Yes, it is.. googling sql tree gives relevant results on both web and newsgroups. If I have a hierarchy of categories, and my model looks like this: class Category(SQLObject): name = UnicodeCol(length=100) parent =

[TurboGears] Re: Encryption

2007-08-01 Thread Marco Mariani
nossatv_sd ha scritto: I have seen people using sha package to encrypt strings (e,g passwords). An example is shapassword = sha.new(kw.get('password')).hexdigest(). Now I am not sure how to decrypt the password encrypted this way This is not encryption. Please, please have an idea of what a

[TurboGears] Re: Encryption

2007-08-01 Thread Marco Mariani
Richard Clark ha scritto: Uncalled for. Probably, or maybe I should've explained myself a little more. Oh, come on, there was a double smiley :-) The vast majority of web developers have no idea what a hash function is, and have no need to know. That's why identity Just Works. The day

[TurboGears] Re: How will Turbogears improve Pylons?

2007-08-01 Thread Marco Mariani
johnbraduk ha scritto: People never seem to learn that if it ain't broke don't fix it. John With all due respect to Ian Bicking, SQLObject 2.0 is broken in some way, or we would already have a 2.0 release: http://blog.ianbicking.org/sqlobject-2.html This is without going deep in the

[TurboGears] Re: Installation and Kubuntu

2007-08-01 Thread Marco Mariani
saliez ha scritto: [...] * However I do not understand the UBUNTU philosophy about the management of external packages: I understand well they cannot provide full support for all external packages, particularly when they are continuously under developements. The problem of the current

[TurboGears] Re: Many changes in SA 0.4 - does it affect Turbogears?

2007-07-30 Thread Marco Mariani
Gaetan de Menten ha scritto: What's worse (from an upgrade point of view) is that many query methods are also deprecated (though still present in 0.4), namely get_by, select, select_by, etc... Most of these should be replaced by a filter_by() call. For example, MyClass.get_by(name=test)

[TurboGears] BrowsingSession and redirects

2007-07-26 Thread Marco Mariani
I've just switched my ftests from twill+mechanize+... (too complex for my taste) to testutil.BrowsinSession. It seems BrowsingSession does not follow redirects, like the previous setup did. So, I have to manually call the new URL from the test methods.. I tried naively fixing the issue in my

[TurboGears] Re: ANN: TGFusionCharts 0.1 released

2007-07-26 Thread Marco Mariani
Jorge Godoy ha scritto: Is there any of those products that allows printing the charts on a standard install of Firefox / IE? 'cause I had a client who didn't buy one of those charting libs because he couldn't print them (and telling all his clients to change something was not

[TurboGears] session_id cookie on firefox

2007-07-24 Thread Marco Mariani
At first, it was strange that all my fancyflash() messages stopped working... then I traced it back to the session_id cookie, that is set (or cleared) but not kept on Firefox between requests. So, this controller: @expose() def session_id(self): import cherrypy

[TurboGears] Re: Session problem

2007-07-23 Thread Marco Mariani
Shan ha scritto: SessionNotEnabledError: bound method Root.index of shan.controllers.Root object at 0x917620c do you have session_filter.on = True in your config? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[TurboGears] TurboGears 1.0.3 is out SQLAlchemy DBTestCase

2007-07-20 Thread Marco Mariani
First thing, I'd like to thank you for the release. Second thing, I'd also love if somebody could help me understanding why all my unittests are failing after the upgrade :-)) Basically, it seems like the transactions are not rolled back. I use SQLAlchemy. I create the test db, complete

[TurboGears] Re: generating msword or excel docs from python?

2007-07-16 Thread Marco Mariani
iain duncan ha scritto: I would like to add the option for my client to download ready to print invoices as one big doc, and am wondering what people would use to do that. I have heard good things about the Apache POI project, but it seems to have only Ruby bindings. Anyone have any

[TurboGears] a couple of widget itches I'd like to scratch

2007-07-16 Thread Marco Mariani
I'm currently doing some more integration of YUI widgets in TGWidgets, on top of Mr Kubacki's package, and I wonder if there are best practices (or framework mechanisms I've overlooked) to.. 1) have an 'id' property much like the field_id in FormField, to be able to properly refer to the

[TurboGears] Re: generating msword or excel docs from python?

2007-07-16 Thread Marco Mariani
Jorge Godoy ha scritto: For Excel you can use CSV and it will open it. Sure. Except, it will try and cast the strings to number, dates, and the like, depending on content... you might not like it. Openoffice or KOffice are no better, and will try and cast the types in a different way. If

[TurboGears] Re: a couple of widget itches I'd like to scratch

2007-07-16 Thread Marco Mariani
Jorge Godoy ha scritto: 1) have an 'id' property much like the field_id in FormField, to be able to properly refer to the widget container in YUI's constructors and CSS Hmmm... You can override the mechanism used on widgets to do that. But you have to be careful because it is

[TurboGears] Re: put a link into a grid widget cell

2007-07-12 Thread Marco Mariani
On Thu, 12 Jul 2007 18:21:40 +0200, Diez B. Roggisch [EMAIL PROTECTED] wrote: def get_link(o): el = Element('a',href=tg.url('/path/to/view/',object=o.id) el.text = o.description return el This should be easier doable using the KID XML-function: def get_link(o): return

[TurboGears] Re: Update on the status of TG

2007-07-04 Thread Marco Mariani
Alberto Valverde ha scritto: There are also many others which I haven't mentioned but have not helped less and I'd like to publicly thank them now (we know who you are! the changelog never lies ;) This is a welcome status update, thank you. BTW, will some of the TG developers be in

[TurboGears] Re: Sqlalchemy save and flush -- best practice?

2007-06-29 Thread Marco Mariani
Sanjay ha scritto: thing.save() session.flush() I use just session.flush() or thing.flush(). What is thing.save() used for? It's needed when your mappers are not implicitly attached to a session. If you use assign_mapper like most turbogearers, save() is useless.

[TurboGears] Re: logging anomaly

2007-06-27 Thread Marco Mariani
Jesse James ha scritto: Which handler are you using? http://docs.python.org/lib/node410.html RotatingFileHandler. ...which inherits from FileHandler, which inherits from StreamHandler, which is buffered. The open() is in FileHandler.__init__... there is 'mode' and 'encoding'

[TurboGears] Re: Making decisions about TG

2007-06-27 Thread Marco Mariani
Florent Aide ha scritto: This does not mean that I don't use other libs for display effects... ever looked at qooxdoo? (http://qooxdoo.org/) Did you use it? Is the API clean enough? From my 20 seconds inspection, it seems lighter than dojo. Does it play well with the mighty pythonic

[TurboGears] Re: TurboGears in the Plat_Forms survey

2007-06-27 Thread Marco Mariani
willhardy ha scritto: PS: if you are a member of digg or Slashdot and would like to support the survey, here are the relevant articles: http://digg.com/programming/How_does_your_web_development_platform_rate http://slashdot.org/firehose.pl?op=viewid=205681 is this a joke or what?

[TurboGears] Re: TurboGears in the Plat_Forms survey

2007-06-27 Thread Marco Mariani
Marco Mariani ha scritto: PS: if you are a member of digg or Slashdot and would like to support the survey, here are the relevant articles: http://digg.com/programming/How_does_your_web_development_platform_rate http://slashdot.org/firehose.pl?op=viewid=205681

[TurboGears] Re: TurboGears in the Plat_Forms survey

2007-06-27 Thread Marco Mariani
Sylvain Hellegouarch ha scritto: I don't _NEED_ two different platforms, do I? Maybe the question is not correctly asked but this happens quite often that you have to work on different environment. Well it happens to me anyway. Different python environments, yes. And some amount

[TurboGears] Re: Making decisions about TG

2007-06-26 Thread Marco Mariani
iain duncan ha scritto: Thanks Alaa. I will try sqlalchemy and genshi. I'm not far enough down a path with either sqlobject or kid to feel indebted to using those going forward. I would second that suggestion. If you start down the road with TG using Genshi, SA, and maybe even

[TurboGears] Re: Password not getting encrypted

2007-06-26 Thread Marco Mariani
Sanjay ha scritto: As I understand from the commented documentation in app.cfg (see below), if I assign a text password to any user object like this: u.password = 'clear text' No.. as you can see in test_identity.py, the password content is meant to be already encrypted. def

[TurboGears] Re: is it easy to change the name of a project

2007-06-21 Thread Marco Mariani
Daniel Fetchinson ha scritto: nice shot! I've put this into TG FAQ: http://docs.turbogears.org/FAQ#q-033 Well, care is needed if the name of the project also appears as variable/class/method/etc names which might very well be the case. This recipe could make a mess for somebody

[TurboGears] Re: My turbogears.flash() alternative

2007-06-12 Thread Marco Mariani
[EMAIL PROTECTED] ha scritto: That's an interesting suggestion. I'm not a CherryPy expert, so how do I bind something to a request like that? This way: def get_flash_service(): try: ret = cherrypy.request.flash_service except AttributeError: ret =

[TurboGears] Re: My turbogears.flash() alternative

2007-06-11 Thread Marco Mariani
[EMAIL PROTECTED] ha scritto: Hi everyone, I've done some more work on my alternative to turbogears.flash(), and it's pretty decent as this point (at least I think so), and it might be useful for others. Thank you, it's just like what I needed, the way I would have done it :-) I

  1   2   >