Re: Algorithm for Labels like in Gmail

2006-06-10 Thread Rodolfo
Hi George,

George Sakkis wrote:

> Google for "many-to-many relationships". In short, you have two entity
> classes (say emails and labels) where each instance of one entity may
> be associated to zero or more instances of the other entity. In
> databases you implement this by having three tables, one for each
> entity and one for their association:
>
>Email RelEmailLabel Label
> --   ---
> ID<--- EmailID  ID
> subjectLabelID ---> name
> ... ...
>

Ok, but how can I keep my Relationship Table out of bugs, bad data?!
I wonder how i'll control the following:
1st) Given an generic email, in which group(s) is it contained?
2nd) Given a group, which Emails/contacts does it contain?

I don't have much expererience with databases (yet).
Will the pysqlite work with ease? Because I don't mean to make a big
big program, just something very simple for my personal use.

>
> Then you can associate mails to labels by joining all three tables
> together on the IDs. Of course you can implement this in memory as well
> but you should probably want to store them in some persistent area
> anyway, so an rdbms the way to go. Sqlite (with pysqlite) would meet
> your needs just fine.

I'll google for this module tomorrow and try to learn something about
it.
I plan to post the code I manage to write.

BTW which is the best way to store all those data files? Plain text
files? Some kind of binary file? or what?

Thank you once again,

Rodolfo

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Algorithm for Labels like in Gmail

2006-06-11 Thread Rodolfo
Thanks to you all.

I'll start trying the buzhug solution, which seems more pythonic. But I
feel like I gotta learn how to use databases... once I studied SQL a
litle bit, but don't remember much.
I'll play around with Python and then I show what I got.

Bye

Rodolfo

P.S:  Is there a way to do a "clear screen" on a Python program? I mean
something like the "cls" command in MS-DOS

-- 
http://mail.python.org/mailman/listinfo/python-list


HTTP Session Issue

2006-01-30 Thread Rodolfo S. Carvalho
Hi,
I'm working with a 100% dependecy-free web app for python, and I'm
taking an overview about HTTPServer and CGIHTTPRequestHandler. In my
researches, I don't found anything about  HTTP Sessions... Can
python natively hadle http sessions, or I'll must write with by hand?

Rodolfo.

-- 
http://mail.python.org/mailman/listinfo/python-list

Python module question

2007-02-05 Thread Rodolfo S. Carvalho

Hi folks
I have a question for this mailing list.

When I'm writing a class, I can rewrite the method __getattr__() to modify
the object's method/attribute access behavior.
My question is: can I code a method __getattr__() to change the behavior of
the 'import' command?

--
   Rodolfo Carvalho
Web Developer
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list