[Python] DjangoCon

2012-03-20 Per discussione Simone Federici
Chi ci va?

DjangoCon Europe 2012 Early Bird registration and Call For Papers

http://2012.djangocon.eu/
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


[Python] Aperte le iscrizioni all'Agile Coach Camp italiano

2012-03-20 Per discussione Simone Federici
Sono aperte le iscrizioni all'Agile Coach Camp italiano:

 http://accitaly.wordpress.com

Se avete qualche interesse per il coaching, vi conviene iscrivervi. E'
un bell'evento, sia dal punto di vista sociale che da quello dei
contenuti.

 ciao
Simone
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


[Python] Concatenazione lato DB => Rebus

2012-03-20 Per discussione Simone Federici
Dato queste coppie di chiavi

keys = [
("LDAP server", "Agent"),
("-LDAP-server-", "_S-"),
("Pippo'", "'pluto"),
("Pippo", NULL)
("Pippo", "")
]

tramite SQL:

   - PGSQL quote_literal(column1) || '_' ||quote_literal(column2)
   - SQLITE quote(col1) || '_' || quote(col2)
   - ORACLE ||replace(col1, , '')||'''_'''||replace(col2, ,
   '')||
   - MYSQL concat(, replace(coalesce(column1, ''), , ''),
   '''_''', replace(coalesce(column2, ''), , ''), )

otterrei questo:

   - 'LDAP server'_'Agent'
   - '-LDAP-server-'_'_S-'
   - 'Pippo'''_'''pluto'
   - 'Pippo'_''
   - 'Pippo'_''shoud be => 'Pippo'_


*c'è da capire come fare a differenziare gli ultimi 2 casi, con NULL o
stringa vuota*

Devo definire lato DB una funzione di concatenazione cross database che
posso anche replicare in python.

in python è facile però santa miseria in ANSI SQL non si può fare un cavolo
:-)

la risposta che dovrò farvi dopo la vostra prima domanda è:
La devo fare anche non in python perché mi serve su DB, questioni di
performance joins tra tabelle.
Altrimenti dovrei prendere tutti gli id di tutta la tabella A, concatenarli
e passarli alla query successiva sulla tabella B.


spiegazione lunga -> potete non leggerla e aiutarmi comunque a risolvere il
problema :-)
è per la risoluzione di un problema per le chiavi composte per django, in
relazione alle sue generic relations, dove django va a scrivere la chiave
(content_id), essendo una app che deve andare bene per tetti i modelli
 (guarda ad esempio il log dell'admin), deve funzionare anche con i modelli
che hanno una chiave composta, quindi cosa ci scrivo dentro il content_id,
qualcosa che mi concateni le parti delle chiavi e che però sia calcolabile
anche con SQL per inserirlo nelle join tra le tabelle.
https://github.com/simone/django-compositekey

grazie
S
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


[Python] Simone Federici wants to chat

2012-03-20 Per discussione Simone Federici
---

Simone Federici wants to stay in better touch using some of Google's coolest new
products.

If you already have Gmail or Google Talk, visit:
http://mail.google.com/mail/b-51de0174bd-fd59108312--uCEsE6Ps-TaLYm9DLZ1HiTMHgk
You'll need to click this link to be able to chat with Simone Federici.

To get Gmail - a free email account from Google with over 2,800 megabytes of
storage - and chat with Simone Federici, visit:
http://mail.google.com/mail/a-51de0174bd-fd59108312--uCEsE6Ps-TaLYm9DLZ1HiTMHgk

Gmail offers:
- Instant messaging right inside Gmail
- Powerful spam protection
- Built-in search for finding your messages and a helpful way of organizing
  emails into "conversations"
- No pop-up ads or untargeted banners - just text ads and related information
  that are relevant to the content of your messages

All this, and its yours for free. But wait, there's more! By opening a Gmail
account, you also get access to Google Talk, Google's instant messaging
service:

http://www.google.com/talk/

Google Talk offers:
- Web-based chat that you can use anywhere, without a download
- A contact list that's synchronized with your Gmail account
- Free, high quality PC-to-PC voice calls when you download the Google Talk
  client

We're working hard to add new features and make improvements, so we might also
ask for your comments and suggestions periodically. We appreciate your help in
making our products even better!

Thanks,
The Google Team

To learn more about Gmail and Google Talk, visit:
http://mail.google.com/mail/help/about.html
http://www.google.com/talk/about.html

(If clicking the URLs in this message does not work, copy and paste them into
the address bar of your browser).
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Simone Federici wants to chat

2012-03-20 Per discussione Carlo Miron
grande simone.

On Tue, Mar 20, 2012 at 22:15, Simone Federici  wrote:
> ---
> Simone Federici wants to stay in better touch using some of Google's coolest 
> new
> products.
[snip]

©
-- 
  R
K--S
  L
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Simone Federici wants to chat

2012-03-20 Per discussione Simone Federici
Si ok,

apro il thread a insulti vari, tutto ammesso :-)
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Concatenazione lato DB => Rebus

2012-03-20 Per discussione Stefano Dal Pra
Non so se ho capito bene cosa ti serve, ma con questo:
keys = [
("LDAP server", "Agent"),
("-LDAP-server-", "_S-"),
("Pippo'", "'pluto"),
("Pippo", None),
("Pippo", "")
]

T=[]
for a,b in keys:
print q.curs.mogrify("select trim(%s|| coalesce( '_'||%s,''
),'_');",(a,b))
q.curs.execute("select trim(%s|| coalesce( '_'||%s,'' ),'_');",(a,b))
T.append(q.curs.fetchone()[0])

print '\n'.join(T)


Ottengo:
>>> T=[]
>>> for a,b in keys:
... print q.curs.mogrify("select trim(%s|| coalesce( '_'||%s,''
),'_');",(a,b))
... q.curs.execute("select trim(%s|| coalesce( '_'||%s,''
),'_');",(a,b))
... T.append(q.curs.fetchone()[0])
...
select trim('LDAP server'|| coalesce( '_'||'Agent','' ),'_');
select trim('-LDAP-server-'|| coalesce( '_'||'_S-','' ),'_');
select trim('Pippo'''|| coalesce( '_'||'''pluto','' ),'_');
select trim('Pippo'|| coalesce( '_'||NULL,'' ),'_');
select trim('Pippo'|| coalesce( '_'||'','' ),'_');
>>> print '\n'.join(T)
LDAP server_Agent
-LDAP-server-__S-
Pippo'_'pluto
Pippo
Pippo

Ciao
Stefano



2012/3/20 Simone Federici 

> Dato queste coppie di chiavi
>
> keys = [
> ("LDAP server", "Agent"),
> ("-LDAP-server-", "_S-"),
> ("Pippo'", "'pluto"),
> ("Pippo", NULL)
> ("Pippo", "")
> ]
>
> tramite SQL:
>
>- PGSQL quote_literal(column1) || '_' ||quote_literal(column2)
>- SQLITE quote(col1) || '_' || quote(col2)
>- ORACLE ||replace(col1, , '')||'''_'''||replace(​col2,
>, '')||
>- MYSQL concat(, replace(coalesce(column1, ''), , ''),
>'''_''', replace(coalesce(column2, ''), , ''), )
>
> otterrei questo:
>
>- 'LDAP server'_'Agent'
>- '-LDAP-server-'_'_S-'
>- 'Pippo'''_'''pluto'
>- 'Pippo'_''
>- 'Pippo'_''shoud be => 'Pippo'_
>
>
> *c'è da capire come fare a differenziare gli ultimi 2 casi, con NULL o
> stringa vuota*
>
> Devo definire lato DB una funzione di concatenazione cross database che
> posso anche replicare in python.
>
> in python è facile però santa miseria in ANSI SQL non si può fare un
> cavolo :-)
>
> la risposta che dovrò farvi dopo la vostra prima domanda è:
> La devo fare anche non in python perché mi serve su DB, questioni di
> performance joins tra tabelle.
> Altrimenti dovrei prendere tutti gli id di tutta la tabella A,
> concatenarli e passarli alla query successiva sulla tabella B.
>
>
> spiegazione lunga -> potete non leggerla e aiutarmi comunque a risolvere
> il problema :-)
> è per la risoluzione di un problema per le chiavi composte per django, in
> relazione alle sue generic relations, dove django va a scrivere la chiave
> (content_id), essendo una app che deve andare bene per tetti i modelli
>  (guarda ad esempio il log dell'admin), deve funzionare anche con i modelli
> che hanno una chiave composta, quindi cosa ci scrivo dentro il content_id,
> qualcosa che mi concateni le parti delle chiavi e che però sia calcolabile
> anche con SQL per inserirlo nelle join tra le tabelle.
> https://github.com/simone/​django-compositekey
>
> grazie
> S
>
>
> ___
> Python mailing list
> Python@lists.python.it
> http://lists.python.it/mailman/listinfo/python
>
>
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python