[tg-trunk] Config files
So now that CherryPy config is pretty much global config only, any thoughts on how we should best manage configuration files in TurboGears 1.1 in order to provide some level of backwards compatibility to our users? -- Mark Ramm-Christensen email: mark at compoundthinking dot com blog: www.compoundthinking.com/blog --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Trunk group. To post to this group, send email to turbogears-trunk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~--~~~~--~~--~--~---
[tg-trunk] Re: Config files
On Feb 26, 2007, at 7:42 PM, Mark Ramm wrote: So now that CherryPy config is pretty much global config only, any thoughts on how we should best manage configuration files in TurboGears 1.1 in order to provide some level of backwards compatibility to our users? I'll respond with a question (don't ya hate that?) To what end is the config format changing? In scenarios where you're only running one TG app in a server, the config file doesn't need to change, right? So, where your question is going likely has more to do with the scenario where you want to run multiple apps within one server. Given that, backwards compatibility (probably with a deprecation warning) can be maintained for people who are only running one app within a server. Then it just becomes the simple matter of what config file format to use for composing multiple apps together into a site, which I will leave as an exercise for the reader. :) Kevin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Trunk group. To post to this group, send email to turbogears-trunk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~--~~~~--~~--~--~---
[tg-trunk] MonkeyPatch for CherryPy AutoLoader
We monkeypatched the CherryPy 3.0 autoloader, anybody know why? CherryPy 3 has rewriten the autoloader code, and it would be good to know if we need to rewrite this monkey patch to work against the new code. -- Mark Ramm-Christensen email: mark at compoundthinking dot com blog: www.compoundthinking.com/blog --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Trunk group. To post to this group, send email to turbogears-trunk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: OpenLaszlo
On Sun, 25 Feb 2007 23:48:14 - GinTon [EMAIL PROTECTED] wrote: Does anybody has tried to use TG and OpenLaszlo? OpenLaszlo is an open source platform for creating zero-install web applications with the user interface capabilities of desktop client software. http://www.openlaszlo.org/ How exactly do you plan to use them both? Since laszlo apps can communicate with server via XML you can easily use TG to generate XML for openlaszlo SOLO deployment flash. In SOLO deployment you don't need tomcat. Read the docs on deployment options and restrictions. There is a Laszlo plugin for Rails but I would use it into a python web framework if is possible. Plugin for Rails? What for, I wonder Best regards, Alexey. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Select Field entries not updating? Are they being cached?
How are you loading the options in the widget's select field ? At widget instantiation or by passing them in at display time ? -Ian On 2/25/07, schnuer.com [EMAIL PROTECTED] wrote: Hi, I'm using widgets. I guess if i did it by hand it would work since when i output the same information with a py:if as just text in the template it shows up as it should. Fabian -Original Message- From: turbogears@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ian Wilson Sent: 26 February 2007 00:19 To: turbogears@googlegroups.com Subject: [TurboGears] Re: Select Field entries not updating? Are they being cached? How are you putting the options into the select fields? Are you using widgets or just doing it by hand ? -Ian On 2/25/07, schnuer.com [EMAIL PROTECTED] wrote: Hi, In my project i have several cases where on for example controller A i can add items to the database that are then going to be possible options in a select or multiple select field in controller B. Now when i add something new it works fine, in the database the things turn up and when looping over them to write them into a template as html everything shows up. But when i then navigate over to controller B the new items don't show up in the (multiple) select field until i restart turbogears. when i hit controller B with another browser however it is being updated. So somehow i guess the browser must cache these lists (IE and firefox both show this behaviour). Both controller A and B are secure resources so a session is maintained. Might that be the reason or is it something completely different? Most importantly however, how do i get around this? Thank you, Fabian --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Reloading Widgets
You can either assign a callable to options that returns an update to date list of items or pass them in at display time. To use a callable do something like this: #Define the callable somewhere def get_item_list(): return [(item.id, item.name) for item in model.Item.select(model.Item.q.active == True, orderBy='name')] #Define the items like this items = widgets.CheckBoxList(validator=validators.Int(), options=get_item_list) -Ian On 2/23/07, Carlos Hanson [EMAIL PROTECTED] wrote: Greetings, I have created a couple widgets: ItemFields and MenuFields. Both extend WidgetsList. I use both in a TableForm. The ItemFields are used to create an Item, while the MenuFields are used to create a Menu. In my MenuFields class, I select all the Items (model.Item.select()) and use the results to populate a CheckBoxList. The problem I have is after adding a new Item, it does not show in the TableForm made from the MenuFields. How do I ensure the CheckBoxList in my MenuFields is always up to date. Thanks in advance. My code follows: class ItemFields(widgets.WidgetsList): Form fields for creating an Item. name = widgets.TextField(validator=validators.NotEmpty()) active = widgets.CheckBox(attrs=dict(checked=True), help_text='If unchecked, it is unavailable to new menus.') class MenuFields(widgets.WidgetsList): Form fields for creating a Menu. item_list = [] all_items = model.Item.select(model.Item.q.active == True, orderBy='name') for item in list(all_items): item_list.append((item.id, item.name)) date = widgets.CalendarDatePicker(date) items = widgets.CheckBoxList(validator=validators.Int(), options=item_list) item_form = widgets.TableForm( fields=ItemFields(), action='save', submit_text='Add Item') menu_form = widgets.TableForm( fields=MenuFields(), action='save', submit_text='Add Menu') class Menu(controllers.Controller): @expose(template='.templates.add') def add(self, tg_errors=None): Show the Menu form. if tg_errors: flash('There was a problem with the form!') return dict(form=menu_form) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: How to set validator in a custom widget?
On Monday 26 February 2007 00:52, Olli Wang wrote: Hi, I was making a widget that let people choose their birth date. The widget is displayed by three selection html tag, each is month, day, and year respectively. But I stuck in how to group this three value in my widget and make a validator by DateConvert() first then pass to DateValidator, the user should see the error message from DateValidator. Here's my current code: This is my validator for a very similar case (with some additional checking you can ignore of course: class GroupDetailsValidator(FormValidator): messages = { 'invalid_date': _(Invalid date.), 'date_not_in_future': _(Date must be in the future.), 'invalid_visitors': _(You need to give a positive number of visitors.), } def validate_python(self, form_value, state): year, month, day = [int(form_value[name]) for name in ('year', 'month', 'day')] error_dict = {} try: d = datetime.date(year, month, day) except ValueError: error_dict.update({'day' : self.message('invalid_date', state)}) if d = datetime.date.today(): error_dict['year'] = self.message('date_not_in_future', state) if form_value['visitors'] = 0: error_dict['visitors'] = self.message('invalid_visitors', state) if error_dict: raise Invalid(None, None, state, error_dict = error_dict) validate_partial_form = True 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: How to create validators with multiple inputs?
On Sunday 25 February 2007 15:07, Ram Yalamanchili wrote: Hey, Does anyone know how to make validators which act over a range of inputs? For example, i have 3 dropbox fields in my form, for day, month, and year and want to check if the date provided is 18 years old or not. I wrote the following, however if the validator fails, ALL the fields on the page display the error message. I wasn't able to figure a way to limit this error message to a particular set of field(s). I just answered that question for Olli Wang under the subject How to set validator in a custom widget 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] select_ from_ inheritable_ tables
Good day! If you have any idea how to resolve the following problem, please, help me. Thanks in advance. I have in model.py file class Base(InheritableSQLObject): . created = DateTimeCol(default=DateTimeCol.now()) . class BaseSample(Base): name = StringCol(length=40, alternateID=True) I have to search samples and to sort them by date. The function seach defined in controllers.py containes the query: def search(self): model.BaseSample.select(AND(CONTAINSSTRING(model.BaseSample.q.name, something, model.Base.created =='12.12.06')), orderBy=model.Base.created) It gives an error and I undestand why. Because this select query generates the following: SELECT * FROM tables base_sampl, base WHERE. The fields (*) in SELECT query are all from table 'base_sample'. In this place there are no fields from table Base, but orderBy needs the explicit field name from table 'base' (class Base). Thanks for in advance --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: select_ from_ inheritable_ tables
On Monday 26 February 2007 11:41, svetl wrote: Good day! If you have any idea how to resolve the following problem, please, help me. Thanks in advance. I have in model.py file class Base(InheritableSQLObject): . created = DateTimeCol(default=DateTimeCol.now()) . class BaseSample(Base): name = StringCol(length=40, alternateID=True) I have to search samples and to sort them by date. The function seach defined in controllers.py containes the query: def search(self): model.BaseSample.select(AND(CONTAINSSTRING(model.BaseSample.q.name, something, model.Base.created =='12.12.06')), orderBy=model.Base.created) It gives an error and I undestand why. Because this select query generates the following: SELECT * FROM tables base_sampl, base WHERE. The fields (*) in SELECT query are all from table 'base_sample'. In this place there are no fields from table Base, but orderBy needs the explicit field name from table 'base' (class Base). The above clearly isn't what you actually have in your code, or it gives you a different error altogether. Because you miss the model.Base.q several times. Please verify that you really have working code. Apart from that, it should work like this (note the usage of Base model.Base.select(AND(your-criteria, model.Base.q.childName == 'BaseSample'), orderBy=model.Base.q.created) 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: How to set validator in a custom widget?
Hi, could you tell me how to set the self.validator of __init__() of my custom widget? I have no idea how to pass my year/month/day value from client into validator. Thanks. On Feb 26, 5:45 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: On Monday 26 February 2007 00:52, Olli Wang wrote: Hi, I was making a widget that let people choose their birth date. The widget is displayed by three selection html tag, each is month, day, and year respectively. But I stuck in how to group this three value in my widget and make a validator by DateConvert() first then pass to DateValidator, the user should see the error message from DateValidator. Here's my current code: This is my validator for a very similar case (with some additional checking you can ignore of course: class GroupDetailsValidator(FormValidator): messages = { 'invalid_date': _(Invalid date.), 'date_not_in_future': _(Date must be in the future.), 'invalid_visitors': _(You need to give a positive number of visitors.), } def validate_python(self, form_value, state): year, month, day = [int(form_value[name]) for name in ('year', 'month', 'day')] error_dict = {} try: d = datetime.date(year, month, day) except ValueError: error_dict.update({'day' : self.message('invalid_date', state)}) if d = datetime.date.today(): error_dict['year'] = self.message('date_not_in_future', state) if form_value['visitors'] = 0: error_dict['visitors'] = self.message('invalid_visitors', state) if error_dict: raise Invalid(None, None, state, error_dict = error_dict) validate_partial_form = True 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: How to set validator in a custom widget?
On Monday 26 February 2007 12:54, Olli Wang wrote: Hi, could you tell me how to set the self.validator of __init__() of my custom widget? I have no idea how to pass my year/month/day value from client into validator. Thanks. You can't, you have to attach it as chained_validator to a schema. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: How to set validator in a custom widget?
Ok, but I still have no idea how to pass parameters to the chained_validators. Currently I set chained_validators = [BirthDateValidator('month', 'day', 'year')] in my Schema but it caused CherryPy down. The traceback said TypeError: BirthDateValidator() takes at most 0 arguments (3 given). Here's my code: class BirthDateValidator(validators.FormValidator): messages = { 'invalid_date': Invalid date., 'date_not_in_future': Date must be in the future., 'invalid_visitors': You need to give a positive number of visitors., } def validate_python(self, form_value, state): year, month, day = [int(form_value[name]) for name in ('year', 'month', 'day')] error_dict = {} try: d = datetime.date(year, month, day) except ValueError: error_dict.update({'day' : self.message('invalid_date', state)}) if d = datetime.date.today(): error_dict['year'] = self.message('date_not_in_future', state) if form_value['visitors'] = 0: error_dict['visitors'] = self.message('invalid_visitors', state) if error_dict: raise validators.Invalid(None, None, state, error_dict = error_dict) validate_partial_form = True class BirthDateSchema(validators.Schema): month = validators.Int(not_empty=True) day = validators.Int(not_empty=True) year = validators.Int(not_empty=True) chained_validators = [BirthDateValidator('month', 'day', 'year')] class BirthDateField(widgets.WidgetsList): month = widgets.SingleSelectField(options=_get_month_options()) day = widgets.SingleSelectField(options=_get_day_options()) year = widgets.SingleSelectField(options=_get_year_options()) Thanks for help. On Feb 26, 8:07 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: On Monday 26 February 2007 12:54, Olli Wang wrote: Hi, could you tell me how to set the self.validator of __init__() of my custom widget? I have no idea how to pass my year/month/day value from client into validator. Thanks. You can't, you have to attach it as chained_validator to a schema. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Turbogears app with two database-connection?
Johnny Blonde schrieb: I need to develop an app, with something special: I have one legacy database of our main booking software, interbase actually, that i need to access. i am definately not allowed to write/modeify data in it, so it has to be strictly read only. the model, of course, is given within the database. for the app itself to save something i need a second database Had the same situation here and TurboGears provides some very nice mechanisms to handle it. Just split your model into two different packages and use turbogears.database.PackageHub. For example: - legacy.py __connection__ = turbogears.database.PackageHub(myapp.legacy) (my legacy model) - model.py hub = PackageHub(quarantine) __connection__ = hub (your app model) Use the configuration system to define different credentials: sqlobject.dburi = mysql://foo:[EMAIL PROTECTED]/mydb myapp.legacy.dburi = mysql://bar:[EMAIL PROTECTED]/xams would i have two separate models for each database? yes. fs --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
SamFeltus [EMAIL PROTECTED] writes: For levity... http://samfeltus.com/as3/mardi_gras.html Oh my! A 3.61 MB flash page... I believe that plain HTML + CSS + JS would be much faster to load and you could get similar behavior with them... This reminds me why I hate Flash websites... :-P -- Jorge Godoy [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: How to set validator in a custom widget?
This is because the above validator code doesn't take argumens. It gets them directly from the form values. So you just have to amke sure the form_values keys are corrently looked up in the validator, and call it as: chained_validators = [BirthDateValidator()] But, if you want input support so you can use chained_validators = [BirthDateValidator('month', 'day', 'year')] or, chained_validators = [BirthDateValidator(2005,10,1)] you need __unpackargs__ like this: class BirthDateValidator(validators.FormValidator): messages = { 'invalid_date': Invalid date., 'date_not_in_future': Date must be in the future., 'invalid_visitors': You need to give a positive number of visitors., } __unpackargs__ = ('month', 'day', 'year') def validate_python(self, form_value, state): # access the values thru, self.month, self.day, self.year d = date(self.year, self.month, self.day) -- Ram On 2/26/07, Olli Wang [EMAIL PROTECTED] wrote: Ok, but I still have no idea how to pass parameters to the chained_validators. Currently I set chained_validators = [BirthDateValidator('month', 'day', 'year')] in my Schema but it caused CherryPy down. The traceback said TypeError: BirthDateValidator() takes at most 0 arguments (3 given). Here's my code: class BirthDateValidator(validators.FormValidator): messages = { 'invalid_date': Invalid date., 'date_not_in_future': Date must be in the future., 'invalid_visitors': You need to give a positive number of visitors., } def validate_python(self, form_value, state): year, month, day = [int(form_value[name]) for name in ('year', 'month', 'day')] error_dict = {} try: d = datetime.date(year, month, day) except ValueError: error_dict.update({'day' : self.message('invalid_date', state)}) if d = datetime.date.today(): error_dict['year'] = self.message('date_not_in_future', state) if form_value['visitors'] = 0: error_dict['visitors'] = self.message('invalid_visitors', state) if error_dict: raise validators.Invalid(None, None, state, error_dict = error_dict) validate_partial_form = True class BirthDateSchema(validators.Schema): month = validators.Int(not_empty=True) day = validators.Int(not_empty=True) year = validators.Int(not_empty=True) chained_validators = [BirthDateValidator('month', 'day', 'year')] class BirthDateField(widgets.WidgetsList): month = widgets.SingleSelectField(options=_get_month_options()) day = widgets.SingleSelectField(options=_get_day_options()) year = widgets.SingleSelectField(options=_get_year_options()) Thanks for help. On Feb 26, 8:07 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: On Monday 26 February 2007 12:54, Olli Wang wrote: Hi, could you tell me how to set the self.validator of __init__() of my custom widget? I have no idea how to pass my year/month/day value from client into validator. Thanks. You can't, you have to attach it as chained_validator to a schema. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: How to set validator in a custom widget?
On Monday 26 February 2007 13:49, Olli Wang wrote: Ok, but I still have no idea how to pass parameters to the chained_validators. Currently I set chained_validators = [BirthDateValidator('month', 'day', 'year')] in my Schema but it caused CherryPy down. The traceback said TypeError: BirthDateValidator() takes at most 0 arguments (3 given). Here's my That is becaused you mixed my code with yours. My code doesn't take three arguments, it is hardcoded to know the field-names - as you can see. Of course it would be possible to make that an constructor argument - but then you need to code things a bit different. I'm not totally sure, but putting __unpackargs__ = ('month', 'day', 'year', ) to the validator class declaration and then access the value using self.month, self.day, self.year 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: changes to controller not recognized
On Feb 25, 4:01 pm, John Cartwright [EMAIL PROTECTED] wrote: I'm just starting w/ TurboGears and can't seem to get a new path defined. I added the following method to controllers.py, but @expose(template=jcc.templates.helloworld) def hello(self): import time # log.debug(Happy TurboGears Controller Responding For Duty) return dict(now=time.ctime()) Is that method part of the RootController class? If it's not explicitly associated with a class derived from Controller, then it doesn't get mapped to a URL. -- Ben Sizer --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Install problem on Mac OS X
I am also getting this error, even using tgsetup.py I guess I am going to have to install Xcode and try that, although I am not quite sure what I am supposed to be compiling or how to compile it and where to compile it to :) On Feb 6, 2:06 am, Mark Ramm [EMAIL PROTECTED] wrote: If you got this by doing an easy_install turbogears, I think you should try using tg-setup.py which should download binary eggs from the turbogears site rather than from the cheeseshop itself. The other easy way to fix this is to download and install Xcode from apple. Then you'll have a compiler, and cheetah should compile and run just fine. --Mark Ramm On 2/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: It looks like Cheetah-2.0rc7. Below is the entire error message I got. Downloadinghttp://cheeseshop.python.org/packages/source/C/Cheetah/ Cheetah-2.0rc7.tar.gz#md5=8a3749a203719e0de6b0af0e841f5371 Processing Cheetah-2.0rc7.tar.gz Running Cheetah-2.0rc7/setup.py -q bdist_egg --dist-dir /tmp/ easy_install-syntcx/Cheetah-2.0rc7/egg-dist-tmp-66dPdA warning: no files found matching '*.cfg' warning: no files found matching 'examples' warning: no files found matching 'docs' warning: no files found matching 'bin' warning: no files found matching '*' under directory 'docs' warning: no files found matching '*' under directory 'examples' warning: no previously-included files matching '*.pyc' found under directory 'src' warning: no previously-included files matching '*~' found under directory 'src' warning: no previously-included files matching '*.aux' found under directory 'src' warning: no previously-included files matching '*~' found under directory 'docs' warning: no previously-included files matching '*.aux' found under directory 'docs' gcc: cannot specify -o with -c or -S and multiple compilations error: Setup script exited with error: command 'gcc' failed with exit status 1 Thanks. On Feb 3, 11:50 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Which package is it trying to compile when you receive this message? On Feb 2, 4:41 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I was trying to install Turbogears on my iBook G4 (MacOSX1.4.8) by running sudo python tgsetup.py. But the install failed with gcc: cannot specify -o with -c or -S and multiple compilations. Can anyone please help me to solve this problem? I have python 2.4.4 installed on my iBook. Thanks in advance. Young-Jin -- Mark Ramm-Christensen email: mark at compoundthinking dot com blog:www.compoundthinking.com/blog --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Strange problem when autoreload.on=False
Hi *, I'm experiencing a strange problem: When autoreload.on is set to True, my app works fine. As soon as I set it to False, the application starts up, but an exception (AssertionError: This transaction has already gone through ROLLBACK; begin another transaction) is thrown on every single call. For the typical stacktrace see below. The utils module, which provides methods for all controllers is always the source of the error. All controller methods that actually return a dict to the template use the utils module to provide standard entries to the dict, i.e. a localized menu structure, etc. : @expose(template=sometemplate) def some_method(self): content = self.get_some_specific_content() return self.utils.default_dict(some_special_extra=content) Within the default_dict method, the best available locale for the user is calculated and loaded from db. The line that bombs is a debug logging statement which outputs the iso code of the loaded locale. Has anyone experienced similar problems? Any ideas as to why this is happening? I'm using TG 1.0.1 and Postgres 8.2. Regards, Puck Traceback (most recent call last): File c:\programme\python243\lib\site-packages\CherryPy-2.2.1- py2.4.egg\cherrypy\_cphttptools.py, line 105, in _run self.main() File c:\programme\python243\lib\site-packages\CherryPy-2.2.1- py2.4.egg\cherrypy\_cphttptools.py, line 254, in main body = page_handler(*virtual_path, **self.params) File string, line 3, in index File c:\programme\python243\lib\site-packages\TurboGears-1.0.1- py2.4.egg\turbogears\controllers.py, line 334, in expose output = database.run_with_transaction( File string, line 5, in run_with_transaction File c:\programme\python243\lib\site-packages\TurboGears-1.0.1- py2.4.egg\turbogears\database.py, line 302, in so_rwt retval = func(*args, **kw) File string, line 5, in _expose File c:\programme\python243\lib\site-packages\TurboGears-1.0.1- py2.4.egg\turbogears\controllers.py, line 351, in lambda mapping, fragment, args, kw))) File c:\programme\python243\lib\site-packages\TurboGears-1.0.1- py2.4.egg\turbogears\controllers.py, line 378, in _execute_func output = errorhandling.try_call(func, *args, **kw) File c:\programme\python243\lib\site-packages\TurboGears-1.0.1- py2.4.egg\turbogears\errorhandling.py, line 73, in try_call return func(self, *args, **kw) File C:\Programme\eclipse3.2\workspace\myapp\myapp\controllers.py, line 39, in index return self.utils.default_dict() File C:\Programme\eclipse3.2\workspace\myapp\myapp\utils.py, line 202, in default_dict loc = get_user_locale() File C:\Programme\eclipse3.2\workspace\myapp\myapp\utils.py, line 156, in get_user_locale log.debug(Best locale for + search_locale + : + retval.code) File string, line 1, in lambda File c:\programme\python243\lib\site-packages\SQLObject-0.7.2- py2.4.egg\sqlobject\main.py, line 988, in _SO_loadValue selectResults = self._connection._SO_selectOne(self, dbNames) File c:\programme\python243\lib\site-packages\SQLObject-0.7.2- py2.4.egg\sqlobject\dbconnection.py, line 823, in __getattr__ self.assertActive() File c:\programme\python243\lib\site-packages\SQLObject-0.7.2- py2.4.egg\sqlobject\dbconnection.py, line 749, in assertActive assert not self._obsolete, This transaction has already gone through ROLLBACK; begin another transaction AssertionError: This transaction has already gone through ROLLBACK; begin another transaction --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
PS I didn't think it was technically interesting, except to show that TurboGears loose coupling of components makes it simple to generate and compile AS3 files, just as easily as it outputs HTML/JS and such. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
I hate flash too. http://flickr.com/photos/lasizoillo/403582010/ 2007/2/26, Jorge Godoy [EMAIL PROTECTED]: SamFeltus [EMAIL PROTECTED] writes: For levity... http://samfeltus.com/as3/mardi_gras.html Oh my! A 3.61 MB flash page... I believe that plain HTML + CSS + JS would be much faster to load and you could get similar behavior with them... This reminds me why I hate Flash websites... :-P -- Jorge Godoy [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
I am sorry I posted it... My apologies... --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
On 2/26/07, SamFeltus [EMAIL PROTECTED] wrote: I am sorry I posted it... Don't be. Posting an example of TurboGears is fine imnsho. If people don't like flash, they're free to say so - but don't take it to heart. If you don't agree with them, don't worry about it - you're entitled to your opinion to. If you do agree with them and this is your work, take the chance to learn from it instead :o) My apologies... I think they're not needed. Arnar --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Turbogears app with two database-connection?
Hello Felix, thanks a lot for your nice comment. i had no time yet to try your tip, but i have few questions on it: the connection to the legacy is established automatically? what happens when i tg-admin sql create? is the legacy model processed as well? (i donĀ“t want it to be processed) how can i lateron access the legacy-model within the app? - i have to import myapp.legacy in order to access it? i now have something like this: = = from datetime import datetime from turbogears.database import PackageHub from sqlobject import * hub = PackageHub(myapp.legacy) __connection__ = hub class Teilnehmer(SQLObject): class sqlmeta: fromDatabase=True idName=NR = = should it work like this? Regards, Frank On 26 Feb., 13:58, Felix Schwarz [EMAIL PROTECTED] wrote: Johnny Blonde schrieb: I need to develop an app, with something special: I have one legacy database of our main booking software, interbase actually, that i need to access. i am definately not allowed to write/modeify data in it, so it has to be strictly read only. the model, of course, is given within the database. for the app itself to save something i need a second database Had the same situation here and TurboGears provides some very nice mechanisms to handle it. Just split your model into two different packages and use turbogears.database.PackageHub. For example: - legacy.py __connection__ = turbogears.database.PackageHub(myapp.legacy) (my legacy model) - model.py hub = PackageHub(quarantine) __connection__ = hub (your app model) Use the configuration system to define different credentials: sqlobject.dburi = mysql://foo:[EMAIL PROTECTED]/mydb myapp.legacy.dburi = mysql://bar:[EMAIL PROTECTED]/xams would i have two separate models for each database? yes. fs --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
SamFeltus schrieb: I am sorry I posted it... No need to. I'm not sure what actually the TG-part of all of this is. But you should do something about the (not)loading screen. It was very irritating to encounter a grey square for more than a couple of seconds, and I actually started safari to see if it works there, only to notice that in the meantime FF had finally loaded it. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Plans for CherryPy 3 and SqlAlchemy
Thanks for the responses! Good information. On 2/24/07, Mark Ramm [EMAIL PROTECTED] wrote: Hopefully we'll be able to get some work done on the CherryPy 3.0 transition next week at the PyCon Sprint. SQLAlchemy support is fine in the core, but we don't yet have anybody working on SQLAlchemy support for the ModelDesigner and Catwalk tools in the toolbox. If anybody is interested in doing that work, that would be a great way to contribute to the project. --Mark Ramm On 2/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I hope this hasn't been asked and answered before, but I couldn't find it. Does anyone know the plans or schedule for moving TurboGears to CherryPy 3, and to possibly make SQLAlchemy a first class citizen. Thanks, Greg -- Mark Ramm-Christensen email: mark at compoundthinking dot com blog: www.compoundthinking.com/blog --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: How to set validator in a custom widget?
Thanks for replies. One more question, how did validator get values directly by form? I currently put my year/month/day widgets under a FieldSet widget, but I have no idea how to get that values from client inputs. Here's my current code. I think if I need to valid that values from client inputs then I couldn't use the __unpackargs__ solution to get work, right? class BirthDateValidator(validators.FormValidator): messages = { 'invalid_date': Invalid date., 'date_not_in_future': Date must be in the future., } def validate_python(self, value, state): year, month, day = [int(form_value[name]) for name in ('year', 'month', 'day')] try: d = date(year, month, day) except ValueError: raise validators.Invalid(self.message('invalid_date', state), value, state) if d = date.today(): raise validators.Invalid(self.message('date_not_in_future', state), value, state) validate_partial_form = True class BirthDateSchema(validators.Schema): chained_validators = [BirthDateValidator()] class SignUpSchema(validators.Schema): birth_date = BirthDateSchema() class BirthDateField(widgets.WidgetsList): month = widgets.SingleSelectField(options=_get_month_options()) day = widgets.SingleSelectField(options=_get_day_options()) year = widgets.SingleSelectField(options=_get_year_options()) class SignUpField(widgets.WidgetsList): birth_date = widgets.FieldSet(label=_('Birth date:'), fields=BirthDateField()) On Feb 26, 7:52 am, Olli Wang [EMAIL PROTECTED] wrote: Hi, I was making a widget that let people choose their birth date. The widget is displayed by three selection html tag, each is month, day, and year respectively. But I stuck in how to group this three value in my widget and make a validator by DateConvert() first then pass to DateValidator, the user should see the error message from DateValidator. Here's my current code: class BirthDatePicker(widgets.FormField): This widget Will replace the current birth date, it's still under construction. template = div xmlns:py=http://purl.org/kid/ns#; input type=text value=test/ select class=birthdatepickermonth name=birthdate_month id=form_birthdate_month option value=[${month}]/option option py:for=name, value in month_names value=${value} py:content=name / /select select class=birthdatepickerday name=birthdate_day id=form_birthdate_day option value=[${day}]/option option py:for=value in day_range value=${value} py:content=value / /select select class=birthdatepickeryear name=birthdate_year id=form_birthdate_year option value=[${year}]/option option py:for=value in year_range value=${value} py:content=value / /select /div params = ['year', 'month', 'day', 'year_range', 'month_names', 'day_range'] year = _('Year') month = _('Month') day = _('Day') month_names = ( (_('January'), 1), (_('Febuary'), 2), (_('March'), 3), (_('April'), 4), (_('May'), 5), (_('June'), 6), (_('July'), 7), (_('August'), 8), (_('September'), 9), (_('October'), 10), (_('November'), 11), (_('December'), 12), ) day_range = range(1, 32) def __init__(self, validator=None, not_empty=True, **kw): super(BirthDatePicker, self).__init__(**kw) self.validator = validator or validators.DateTimeConverter( format=%m/%d/%Y, not_empty=not_empty) def update_params(self, params): super(BirthDatePicker, self).update_params(params) # Get year's range this_year = date.today().year params['year_range'] = range(this_year-5, this_year-115, -1) Any help would be appreciated. Thanks. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: setting i18n.get_locale
I'm struggling with this problem, too... Is there really no one that could answer 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboLucene now has documentation!
Krys, This is a fantastic tutorial! I especially appreciate the recap and in context sections sprinkled throughout...these were a great idea. Looking forward to seeing how TurboLucene develops in the future...especially built-in support for indexing multiple model objects. Kevin Horn On 2/25/07, Krys Wilken [EMAIL PROTECTED] wrote: Well, I finally got around to writing up some documentation for TurboLucene. I've been in a bit of a lethargic state lately, so it's nice to see that that is passing. Anyway... I have written (and coded) a TurboLucene tutorial. In it we add full-text searching capabilities to the TurboGears 20 Minute Wiki. You can find it here: http://dev.krys.ca/turbolucene/wiki/WikiTutorial It should be easy to translate the principles from the turtorial to any TurboGears project. Anyway, feedback is most welcome. I hope this makes TurboLucene more accessible and fun to use. :-) Enjoy! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Template organisation
Thanks for the input. are you sure all your folders are python packages? I think so but am away from base for a few days. if you provide more info we may be able to give a more concrete answer. Didn't really want to bury a guru in detail. You have helpfully answered the question though - it is the right way to go - just need to fix the bugs. Thank you again A --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Investigating TurboGears
Hi all, I'm considering implementing a TurboGears project at work, one because what I've seen I like, and we already like Python here. But I've got a couple of questions I hope people might be able to help me with, or point me in the right direction for more information. We've got a distributed system of processes running on mixed platforms (mostly Linux, but some Windows) which runs as a collection of crontab jobs, files being moved around in folders that awakening processes see, process and move on and XMLRPC communication channels between the detached systems, particularly the windows systems. So here are my questions: 1) I'm looking at Pyro as a communications mechanism between the distributed systems that have Python. Is it possible to support Pyro from within the TurboGears server? 2) To support the Windows machines, and perhaps 3rd party outside users, can I get XMLRPC support inserted into TurboGears in some way? Right now I really like the MVC approach, which TurboGears supports and promotes. In our case we're trying to centralize the Model (the database for us). But the Controllers and the Views could be on other servers, which is why I'm thinking about Pyro to connect to the Model. Any help, advice or warnings would be greatly appreciated, Doug --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Setting SingleSelectField's options in form.display()?
Hi, Title says it. Code as follows: controller.py:: class UsersFields(WidgetList): users = SingleSelectField(options=[(0,'')]) number = Textfield() users_form = TableForm(fields=UsersFields()) def UsersController(controllers.Controller): @expose(template='users') def index(self): # a) -- won't work. form_data = {'number': 42, 'users':[(1, one), (2, two)]} # b) -- won't work. #form_data = {'number': 42, 'users':{'options':[(1, one), (2, two)]}} return dict(users_form=users_form, form_data) users.kid:: ${users_form(form_data)} When rendering the template by accessing .../index, I get two controls: one regular text field with the value 42 inside, and a SELECT-control vith the value . Where did one and two go? What am I doing wrong? Thanks in advance, -- Miakel --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Setting SingleSelectField's options in form.display()?
users_form() or users_form.display() take named arguments so if you pass a dictionary with the arguments inside you need to apply ** to it like this: ${users_form(**form_data)} And you want something like this(the parameter names and then the field's names whose parameter you want set): form_data = dict(value=dict(number=42), options = dict(users = [(1, one), (2, two)])) -Ian On 2/26/07, Mikael Jansson [EMAIL PROTECTED] wrote: Hi, Title says it. Code as follows: controller.py:: class UsersFields(WidgetList): users = SingleSelectField(options=[(0,'')]) number = Textfield() users_form = TableForm(fields=UsersFields()) def UsersController(controllers.Controller): @expose(template='users') def index(self): # a) -- won't work. form_data = {'number': 42, 'users':[(1, one), (2, two)]} # b) -- won't work. #form_data = {'number': 42, 'users':{'options':[(1, one), (2, two)]}} return dict(users_form=users_form, form_data) users.kid:: ${users_form(form_data)} When rendering the template by accessing .../index, I get two controls: one regular text field with the value 42 inside, and a SELECT-control vith the value . Where did one and two go? What am I doing wrong? Thanks in advance, -- Miakel --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Cannot turn off logging to screen or enable file logging
My prod.cfg section has: # SERVER server.environment=production server.log_file=server.log server.log_to_screen=False but it still logs to the screen and does not log to the file. OS: ubuntu 6.06 TurboGears 1.0b1 CherryPy 2.2.1 What am I doing wrong? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Widgets question
Hi, I have a poll system to develop and I need to create a form for each poll dynamicaly. I just have a series of quesitons and a series of potential answers for each questions stored into the database. I was wandering if there is somewhere an example of a form created dynamicaly. Thanks -fred- --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: setting i18n.get_locale
mte schrieb: I'm struggling with this problem, too... Is there really no one that could answer this? I did do exactly that today. The solution is to use config.update. Do this somewhere in your code: config.update({'i18n.get_locale' : your_function}) 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Investigating TurboGears
1) I'm looking at Pyro as a communications mechanism between the distributed systems that have Python. Is it possible to support Pyro from within the TurboGears server? You can use everything python has. 2) To support the Windows machines, and perhaps 3rd party outside users, can I get XMLRPC support inserted into TurboGears in some way? Yes. It is never a problem as a client, and TG can even work as server. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Widgets question
The forms have no general structure whatsoever ? Are they just a question and then a variable number of potential answers? -Ian On 2/26/07, Fred C [EMAIL PROTECTED] wrote: Hi, I have a poll system to develop and I need to create a form for each poll dynamicaly. I just have a series of quesitons and a series of potential answers for each questions stored into the database. I was wandering if there is somewhere an example of a form created dynamicaly. Thanks -fred- --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] _sqlite.DatabaseError: file is encrypted or is not a database
Just ran into this after running python2.4 tgsetup.py. Before I had v 1.0. After reading some posts I found that this has to do, probably, with wrong version of sqlite (2vs3) trying to read the file. I uninstalled sqlite2, left only sqlite3 - same error. I uninstalled sqlite3, left only sqlite2 - same problem. I went to turbogears.org trying to find a way to download old version 1.0, and it seems like there is no link for that.. Not sure if that would help. By the way I'm running Debian stable there.. Here's the traceback, even though I guess it's clear that it's just trying to open the db file and failing: File /home/ak/reg/reg/controllers.py, line 2, in ? from reg import register_controllers File /home/ak/reg/reg/register_controllers.py, line 15, in ? from reg.register_widgets import SearchFields, NewUserFields, NewUserSchema, \ File /home/ak/reg/reg/register_widgets.py, line 35, in ? class SearchFields(widgets.WidgetsList): File /home/ak/reg/reg/register_widgets.py, line 38, in SearchFields options=[(0, Select country..)] + [(country.id, File /usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/ sqlobject/sresults.py, line 160, in __iter__ return iter(list(self.lazyIter())) File /usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/ sqlobject/sresults.py, line 167, in lazyIter conn = self._getConnection() File /usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/ sqlobject/sresults.py, line 43, in _getConnection return self.ops.get('connection') or self.sourceClass._connection File /usr/lib/python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/ turbogears/database.py, line 223, in __get__ return self.hub.__get__(obj, type) File /usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/ sqlobject/dbconnection.py, line 945, in __get__ return self.getConnection() File /usr/lib/python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/ turbogears/database.py, line 130, in getConnection return self.begin(conn) File /usr/lib/python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/ turbogears/database.py, line 164, in begin trans = conn.transaction() File /usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/ sqlobject/dbconnection.py, line 367, in transaction return Transaction(self) File /usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/ sqlobject/dbconnection.py, line 797, in __init__ self._connection = dbConnection.getConnection() File /usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/ sqlobject/sqlite/sqliteconnection.py, line 131, in getConnection conn = self.makeConnection() File /usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/ sqlobject/sqlite/sqliteconnection.py, line 173, in makeConnection return sqlite.connect(self.filename, **self._connOptions) File /usr/lib/python2.4/site-packages/sqlite/__init__.py, line 61, in connect return Connection(*args, **kwargs) File /usr/lib/python2.4/site-packages/sqlite/main.py, line 445, in __init__ self.db = _sqlite.connect(database, mode) _sqlite.DatabaseError: file is encrypted or is not a database --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Reloading Widgets
Sweet. Thanks. I thought about something along those lines before reading the response, but I would have passed a call to the function, get_item_list(), rather than the fuction itself, get_item_list. I need to research why that works. Thanks again, I'll do my reading. On Feb 26, 1:21 am, Ian Wilson [EMAIL PROTECTED] wrote: You can either assign a callable to options that returns an update to date list of items or pass them in at display time. To use a callable do something like this: #Define the callable somewhere def get_item_list(): return [(item.id, item.name) for item in model.Item.select(model.Item.q.active == True, orderBy='name')] #Define the items like this items = widgets.CheckBoxList(validator=validators.Int(), options=get_item_list) -Ian On 2/23/07, Carlos Hanson [EMAIL PROTECTED] wrote: Greetings, I have created a couple widgets: ItemFields and MenuFields. Both extend WidgetsList. I use both in a TableForm. The ItemFields are used to create an Item, while the MenuFields are used to create a Menu. In my MenuFields class, I select all the Items (model.Item.select()) and use the results to populate a CheckBoxList. The problem I have is after adding a new Item, it does not show in the TableForm made from the MenuFields. How do I ensure the CheckBoxList in my MenuFields is always up to date. Thanks in advance. My code follows: class ItemFields(widgets.WidgetsList): Form fields for creating an Item. name = widgets.TextField(validator=validators.NotEmpty()) active = widgets.CheckBox(attrs=dict(checked=True), help_text='If unchecked, it is unavailable to new menus.') class MenuFields(widgets.WidgetsList): Form fields for creating a Menu. item_list = [] all_items = model.Item.select(model.Item.q.active == True, orderBy='name') for item in list(all_items): item_list.append((item.id, item.name)) date = widgets.CalendarDatePicker(date) items = widgets.CheckBoxList(validator=validators.Int(), options=item_list) item_form = widgets.TableForm( fields=ItemFields(), action='save', submit_text='Add Item') menu_form = widgets.TableForm( fields=MenuFields(), action='save', submit_text='Add Menu') class Menu(controllers.Controller): @expose(template='.templates.add') def add(self, tg_errors=None): Show the Menu form. if tg_errors: flash('There was a problem with the form!') return dict(form=menu_form) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] hosting problems
I recommend server pronto be removed from the list at http:// docs.turbogears.org/1.0/Hosting. The customer support is very poor, and their billing practices are insecure (they will publish credit card information on the web). I've outlined this in more detail at http://bewest.wordpress.com/ 2007/02/15/serverpronto-doesnt-understand-privacy-or-security/ and http://bewest.wordpress.com/2007/02/14/serverpronto-will-publish-your- creditcard-on-the-web/. Thanks, Ben --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] AssertionError: This transaction has already gone through ROLLBACK; begin another transaction
I can't reproduce this error right now because TG fails to access database.. but this was bugging me for the last few days. I have a form with 4 drop down menus.. When first menu is chosen, it loads the second through ajax. When second is chosen, it loads 3 4 through ajax. (1st is country, second is state, 3 4 are county and city). It works fine at home but on remote server only the second (state) menu loads, when I change 2nd menu, 34 do not load and I get a traceback from TG that goes, AssertionError: This transaction has already gone through ROLLBACK; begin another transaction . The code in question is this: @expose(format=json) def getCounties(self, state_id, tg_errors=None): #print ###getCounties, counties, , model.State.get(state_id).counties tmp = {id: 0, countyName: Select county..} is_id = False try: state = int(state_id) is_id = True except: state = state_id is_id = False if is_id: counties = [tmp] + model.State.get(state).counties else: counties = [tmp] + model.State.selectBy(stateName=state) [0].counties return dict(counties=counties) getCities is similar. Note that at home I just have try: State.get(id) except: State.selectBy(name=state) and it works fine. On remote server I tried to do this because I thought it might be related to the Rollback error. It didn't help of course.. The reason I'm not sure if I will get an id or a name is that when the menu is loaded from ajax, sometimes it will return name and sometimes id. Menu created by me of course always returns id, as it well should. Again, this doesn't cause trouble at home and I didn't investigate this more yet. I don't think this causes the Rollback error though. From my reading of the group it looks like there was an old bug that was related to this but it was fixed. It was also possible to bring this error about by passing around sqlobject object between transactions (if I understood right) and also there was one case when a function had an empty list as an argument and it was reused in later transactions causing the error.. It looks like this case is something different. Here's the mochikit code..: SCRIPT SRC=/static/javascript/MochiKit.js TYPE=text/javascript/ SCRIPT !--document.write(STATES!!+states)-- script var conn = MochiKit.Signal.connect; function replace_state(req) { var states = evalJSONRequest(req).states; replaceChildNodes($('location_form_state_id'), map( function(p) { return OPTION((p.id,p.stateName)) }, states ) ); } function replace_county(req) { var counties = evalJSONRequest(req).counties; replaceChildNodes($('location_form_county'), map( function(c) { return OPTION((c.id,c.countyName)) }, counties ) ); } function replace_city(req) { var cities = evalJSONRequest(req).cities; replaceChildNodes($('location_form_city'), map( function(city) { return OPTION((city.id,city.cityName)) }, cities ) ); } function state_id_changedb(event) { var state_id = event.target().value; var defb = doSimpleXMLHttpRequest('/getCounties', {state_id : state_id}); defb.addCallback(replace_county); } function state_id_changed(event) { var state_id = event.target().value; var def = doSimpleXMLHttpRequest('/getCities', {state_id : state_id}); def.addCallback(replace_city); } function country_id_changed(event) { var country_id = event.target().value; var def = doSimpleXMLHttpRequest('/getStates', {country_id : country_id}); def.addCallback(replace_state); } function init_state_selector() { conn($('location_form_state_id'), 'onchange', state_id_changedb); conn($('location_form_state_id'), 'onchange', state_id_changed); }; function init_country_selector() { conn($('location_form_country_id'), 'onchange', country_id_changed); }; conn(window, 'onload', init_country_selector); conn(window, 'onload', init_state_selector); /script --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
No need to. I'm not sure what actually the TG-part of all of this is. It is just an example of TurboGears generated Flash, all created and edited in the browser, minus the image editing, done in the GIMP. It's value is comedic... Somewhere in the manual, I read to post anything interesting you did in TurboGears... As to bandwidth, the page is true to the spirit of Mardi Gras. It is wasteful of bandwidth and resources... :) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
On 2/26/07, SamFeltus [EMAIL PROTECTED] wrote: No need to. I'm not sure what actually the TG-part of all of this is. It is just an example of TurboGears generated Flash, all created and edited in the browser, minus the image editing, done in the GIMP. It's value is comedic... Somewhere in the manual, I read to post anything interesting you did in TurboGears... As to bandwidth, the page is true to the spirit of Mardi Gras. It is wasteful of bandwidth and resources... :) There's a bug in your ActionScript somewhere: ReferenceError: Error #1069: Property targetx_text not found on MardiGras2 and there is no default value. at sunshine_nav4::SunshineNav4/::mouse_up() -bob --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
I am reckoning you already know more about the ActionScript in it than I do Bob... :) Sam the Gardener On Feb 26, 9:32 pm, Bob Ippolito [EMAIL PROTECTED] wrote: On 2/26/07, SamFeltus [EMAIL PROTECTED] wrote: No need to. I'm not sure what actually the TG-part of all of this is. It is just an example of TurboGears generated Flash, all created and edited in the browser, minus the image editing, done in the GIMP. It's value is comedic... Somewhere in the manual, I read to post anything interesting you did in TurboGears... As to bandwidth, the page is true to the spirit of Mardi Gras. It is wasteful of bandwidth and resources... :) There's a bug in your ActionScript somewhere: ReferenceError: Error #1069: Property targetx_text not found on MardiGras2 and there is no default value. at sunshine_nav4::SunshineNav4/::mouse_up() -bob --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
PS How did you figure that out, I just have Ubuntu, TG and MXMLC compiler? On Feb 26, 9:40 pm, SamFeltus [EMAIL PROTECTED] wrote: I am reckoning you already know more about the ActionScript in it than I do Bob... :) Sam the Gardener On Feb 26, 9:32 pm, Bob Ippolito [EMAIL PROTECTED] wrote: On 2/26/07, SamFeltus [EMAIL PROTECTED] wrote: No need to. I'm not sure what actually the TG-part of all of this is. It is just an example of TurboGears generated Flash, all created and edited in the browser, minus the image editing, done in the GIMP. It's value is comedic... Somewhere in the manual, I read to post anything interesting you did in TurboGears... As to bandwidth, the page is true to the spirit of Mardi Gras. It is wasteful of bandwidth and resources... :) There's a bug in your ActionScript somewhere: ReferenceError: Error #1069: Property targetx_text not found on MardiGras2 and there is no default value. at sunshine_nav4::SunshineNav4/::mouse_up() -bob --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
I'm using the debug player on Mac OS X. Not sure if there is one available on Linux. There's definitely one for Windows. I think you can get a debug player with the Flex Builder thing. We're in Adobe's pre-release program, so I got mine elsewhere... -bob On 2/26/07, SamFeltus [EMAIL PROTECTED] wrote: PS How did you figure that out, I just have Ubuntu, TG and MXMLC compiler? On Feb 26, 9:40 pm, SamFeltus [EMAIL PROTECTED] wrote: I am reckoning you already know more about the ActionScript in it than I do Bob... :) Sam the Gardener On Feb 26, 9:32 pm, Bob Ippolito [EMAIL PROTECTED] wrote: On 2/26/07, SamFeltus [EMAIL PROTECTED] wrote: No need to. I'm not sure what actually the TG-part of all of this is. It is just an example of TurboGears generated Flash, all created and edited in the browser, minus the image editing, done in the GIMP. It's value is comedic... Somewhere in the manual, I read to post anything interesting you did in TurboGears... As to bandwidth, the page is true to the spirit of Mardi Gras. It is wasteful of bandwidth and resources... :) There's a bug in your ActionScript somewhere: ReferenceError: Error #1069: Property targetx_text not found on MardiGras2 and there is no default value. at sunshine_nav4::SunshineNav4/::mouse_up() -bob --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: TurboGears generated MardiGras page
I will have to get one of those, that's better than the run it in browser until it don't crash method. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: _sqlite.DatabaseError: file is encrypted or is not a database
On Feb 26, 8:44 pm, Rainy [EMAIL PROTECTED] wrote: Just ran into this after running python2.4 tgsetup.py. Before I had v 1.0. After reading some posts I found that this has to do, probably, with wrong version of sqlite (2vs3) trying to read the file. I uninstalled sqlite2, left only sqlite3 - same error. I uninstalled sqlite3, left only sqlite2 - same problem. I went to turbogears.org trying to find a way to download old version 1.0, and it seems like there is no link for that.. Not sure if that would help. By the way I'm running Debian stable there.. Here's the traceback, even though I guess it's clear that it's just trying to open the db file and failing: I can open the file using sqlite3 but trying sqlite 2 gives the same error. Even if I remove sqlite 2 sqlobject still uses it. How do I tell it to use other sqlite? I searched sqlobject docs, pysqlite docs, nothing.. Anybody run into this? The server is Amd64, by the way, if that matters. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Select Field entries not updating? Are they being cached?
Both via instanciation and value during display time and finally ajax call. It does not work when doing it at instanciation time. Fabian -Original Message- From: turbogears@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ian Wilson Sent: 26 February 2007 10:16 To: turbogears@googlegroups.com Subject: [TurboGears] Re: Select Field entries not updating? Are they being cached? How are you loading the options in the widget's select field ? At widget instantiation or by passing them in at display time ? -Ian On 2/25/07, schnuer.com [EMAIL PROTECTED] wrote: Hi, I'm using widgets. I guess if i did it by hand it would work since when i output the same information with a py:if as just text in the template it shows up as it should. Fabian -Original Message- From: turbogears@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ian Wilson Sent: 26 February 2007 00:19 To: turbogears@googlegroups.com Subject: [TurboGears] Re: Select Field entries not updating? Are they being cached? How are you putting the options into the select fields? Are you using widgets or just doing it by hand ? -Ian On 2/25/07, schnuer.com [EMAIL PROTECTED] wrote: Hi, In my project i have several cases where on for example controller A i can add items to the database that are then going to be possible options in a select or multiple select field in controller B. Now when i add something new it works fine, in the database the things turn up and when looping over them to write them into a template as html everything shows up. But when i then navigate over to controller B the new items don't show up in the (multiple) select field until i restart turbogears. when i hit controller B with another browser however it is being updated. So somehow i guess the browser must cache these lists (IE and firefox both show this behaviour). Both controller A and B are secure resources so a session is maintained. Might that be the reason or is it something completely different? Most importantly however, how do i get around this? Thank you, Fabian --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---
[TurboGears] Re: Select Field entries not updating? Are they being cached?
Are you passing a callable at instantiation time? Can you show me a snippet of code where you set the options? -Ian On 2/26/07, schnuer.com [EMAIL PROTECTED] wrote: Both via instanciation and value during display time and finally ajax call. It does not work when doing it at instanciation time. Fabian -Original Message- From: turbogears@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ian Wilson Sent: 26 February 2007 10:16 To: turbogears@googlegroups.com Subject: [TurboGears] Re: Select Field entries not updating? Are they being cached? How are you loading the options in the widget's select field ? At widget instantiation or by passing them in at display time ? -Ian On 2/25/07, schnuer.com [EMAIL PROTECTED] wrote: Hi, I'm using widgets. I guess if i did it by hand it would work since when i output the same information with a py:if as just text in the template it shows up as it should. Fabian -Original Message- From: turbogears@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ian Wilson Sent: 26 February 2007 00:19 To: turbogears@googlegroups.com Subject: [TurboGears] Re: Select Field entries not updating? Are they being cached? How are you putting the options into the select fields? Are you using widgets or just doing it by hand ? -Ian On 2/25/07, schnuer.com [EMAIL PROTECTED] wrote: Hi, In my project i have several cases where on for example controller A i can add items to the database that are then going to be possible options in a select or multiple select field in controller B. Now when i add something new it works fine, in the database the things turn up and when looping over them to write them into a template as html everything shows up. But when i then navigate over to controller B the new items don't show up in the (multiple) select field until i restart turbogears. when i hit controller B with another browser however it is being updated. So somehow i guess the browser must cache these lists (IE and firefox both show this behaviour). Both controller A and B are secure resources so a session is maintained. Might that be the reason or is it something completely different? Most importantly however, how do i get around this? Thank you, Fabian --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~--~~~~--~~--~--~---