Time for me to move on and learn TurboGears2.1. Coming from django background, I expected somewhat similar elegance in TurboGears. Something like urlpatterns, which is quite nice. I did not found something like that. A bit disappointment, because urlpatterns really such a wonderful way to map between url requests and the handlers.
The main and biggest issue with django is it's orm. I really wish somehow we can replace it with sqlalchemy and still having all the auto generated Admin Interface.
Sqlalchemy is totally awesome. If you have not used it yet, please spend sometimes with it.
Since, TurboGears supports sqlalchemy, I decided to take a look and play around with it. The awesome thing about TurboGears 2.1 it also have Administration System, which will auto generate the web interface, using python-rum and sprox.
The first time I used the Admin System, I got the UI (tables and forms) for all the tables prepared. The only issue at that time was the relationship displayed is still using 'id'. Quite confusing for the end-user.
Digging more and more about TurboGears 2.1, I learned that all of the transformations from the table schema into web UI are done via sprox, which uses '_name', 'name', (and some other values) as default values for column name matching relationship representation.
Did some more digging and I figured out how to define the desired column for relationship representation.
class: TableFiller
modifier: __possible_field_names__ = [ 'brand', 'first_name' ]
class: AddRecordForm
modifier: __dropdown_field_names__ = [ 'title' ]
class: EditableForm
modifier: __dropdown_field_names__ = [ 'name', 'info' ]
Those classes could be imported using the following:
from sprox.fillerbase import TableFiller
from sprox.formbase import AddRecordForm, EditableForm
TableFiller is for viewing, AddRecordForm is for adding new record, EditableForm is of course for edit existing record.
So, what you can do is subclass those classes, according to your need, and set either __possible_field_names__, __dropdown_field_names__ or both, to the appropriate columns. Then store the subclasses in the controller (project/app/controllers/root.py, for example).
Tuesday, February 15, 2011
Monday, January 24, 2011
xubuntu alternate install on usb stick
I am working on a project which has to do with very old and low computing power computer and low memory. So, I had to choose a reasonable linux distro with reasonable desktop manager, user interface, etc.
After trying different very lightweight distros, I am back with xubuntu. I have my reasons, which mainly is that I am so familiar with this one.
I tried lubuntu, which uses LXDE, but this old computer could not handle it.
Due to that, I chose xubuntu alternate installer. So, I prepared xubuntu alternate installer in a 2GB usb stick, since the old computer does not have any optical drive.
I faced a problem during installation using the usb media, because the installer keep searching for cdrom (optical) drive. It was terrible. I tried to go to virtual terminal and tried to mount the usb stick manually as a cdrom, but got problem.
Thankfully, I found the way to do it successfully from ubuntu site. http://ping.fm/nDHWx Issues
The required action to solve the problem is simply insert/append the following argument:
'cdrom-detect/try-usb=true'
in the grub boot menu. To do that, just choose which installation method you want to use, in the grub menu and press 'E' to edit the command, and append the argument, which I mentioned earlier, at the end.
Now, enjoy the lightweight installer and the distro itself.
After trying different very lightweight distros, I am back with xubuntu. I have my reasons, which mainly is that I am so familiar with this one.
I tried lubuntu, which uses LXDE, but this old computer could not handle it.
Due to that, I chose xubuntu alternate installer. So, I prepared xubuntu alternate installer in a 2GB usb stick, since the old computer does not have any optical drive.
I faced a problem during installation using the usb media, because the installer keep searching for cdrom (optical) drive. It was terrible. I tried to go to virtual terminal and tried to mount the usb stick manually as a cdrom, but got problem.
Thankfully, I found the way to do it successfully from ubuntu site. http://ping.fm/nDHWx Issues
The required action to solve the problem is simply insert/append the following argument:
'cdrom-detect/try-usb=true'
in the grub boot menu. To do that, just choose which installation method you want to use, in the grub menu and press 'E' to edit the command, and append the argument, which I mentioned earlier, at the end.
Now, enjoy the lightweight installer and the distro itself.
Saturday, November 20, 2010
Thursday, November 11, 2010
Sync Google Calendar with your Gnome Desktop
This is pretty exciting for me. I just realized that I could sync my Ubuntu Gnome Desktop Calendar with my Google Calendar account. And also the great thing about it is that it is really easy to do.
First open your web google calendar account. On the left pane, under "My Calendar" and your email address, click 'Settings'. Then you will see the setting page. Click again your email address to get more detailed settings. On the bottom of this page you will see "Private Address". Copy the private ICAL url.
Once you have done that, open terminal and enter the following command:
$ /usr/lib/evolution-webcal/evolution-webcal YOUR_PRIVATE_ICAL_URL
Set the appropriate configuration if necessary, and you are done.
Now, to see the result, click on the Date Time info on the toolbar (above), and you should see the dates which you have activities (appointments) are marked bold. You should also see 'Appointments' list.
Enjoy managing your time and day with Google Calendar and Gnome Desktop.
First open your web google calendar account. On the left pane, under "My Calendar" and your email address, click 'Settings'. Then you will see the setting page. Click again your email address to get more detailed settings. On the bottom of this page you will see "Private Address". Copy the private ICAL url.
Once you have done that, open terminal and enter the following command:
$ /usr/lib/evolution-webcal/evolution-webcal YOUR_PRIVATE_ICAL_URL
Set the appropriate configuration if necessary, and you are done.
Now, to see the result, click on the Date Time info on the toolbar (above), and you should see the dates which you have activities (appointments) are marked bold. You should also see 'Appointments' list.
Enjoy managing your time and day with Google Calendar and Gnome Desktop.
Tuesday, September 14, 2010
Autostart Vino and Configure Local Connection Only
Continuing my previous post about vnc over ssh, here is a way to limit the connection to local only.
If you are using gnome, you can configure it via gconf-editor. Go to the following key: /desktop/gnome/remote_access/network_interface and set 'lo' as the value. This way, vino server will only listen to local (loopback) interface only.
Now, if you would like to have vino server ready on each time you logged in, you need to configure it from, System -> Preferences -> Desktop Session Settings, and enable Remote Desktop.
Remember to configure Remote Desktop itself, from System -> Preferences -> Remote Desktop Preferences and allow other users to view your dekstop.
If you are using gnome, you can configure it via gconf-editor. Go to the following key: /desktop/gnome/remote_access/network_interface and set 'lo' as the value. This way, vino server will only listen to local (loopback) interface only.
Now, if you would like to have vino server ready on each time you logged in, you need to configure it from, System -> Preferences -> Desktop Session Settings, and enable Remote Desktop.
Remember to configure Remote Desktop itself, from System -> Preferences -> Remote Desktop Preferences and allow other users to view your dekstop.
Subscribe to:
Posts (Atom)