Re: [Mailman-Developers] mailman.client and UUIDs for user.user_id
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi Aurélien,
On 10/27/2014 04:36 PM, Aurelien Bompard wrote:
Hey folks,
Mailman stores user_ids as UUIDs in the database, and they are converted on the fly to integers by the REST API. However, the mailmanclient library do not convert them back to UUID. Do you think this is something that it should do, or should I handle this conversion in my own code?
I think mailmanclient should not expose a different value as the REST API does (the fact that it's an int representation of a uuid isn't exactly obvious from the outside, so a non-explicit conversion could potentially lead to some confusion).
But how about we add a uuid
property to the user object which
exposes the original uuid value?
Florian
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEcBAEBAgAGBQJUUObFAAoJEEceGbPdavl7GsgH/2PsrcCdwKCMcOWAqsci0XYN 458TrvIbgRolMMlW9RogMgcavNJUSaWwB9nSjjU3UV6Z2bCbRJEhBXSce6tNEbJF XZZ5Cdy8I7gGXhfmeP1/+enDSO+lB655KngXBZdhP1IeYME49z1yJnqH6bafsM1e 9YOecu0nVvjUFbpMwVdJVVPhcml0D/qVIcN0wD5ZXfO01m+bx2yTt2cuUkrj7SMt b756OQIcYIBJW3rqr+5kTr/FDCbsN1TrH921k8ZcgthfxMpmYeSwueeIizjFyf0H VAxa83l4uLyzK1LDtXZ4mkimMHIQhSvpGNSJdhPBVLW8oGomnqpPSdu/w/l5KtY= =Lyma -----END PGP SIGNATURE-----
Hi Florian!
I think mailmanclient should not expose a different value as the REST
API does (the fact that it's an int representation of a uuid isn't exactly obvious from the outside, so a non-explicit conversion could potentially lead to some confusion).
Hmm, to me the current situation is more confusing, since the user_id property I get from the REST API is different from the one I find in the database. I guess it depends on the reason the UUID is serialized. If it's to avoid being messed up during the transport, it's a transport issue and I think the library should convert it back (but the original ascii string should not be a problem so it's probably not that. Anyone remembers why the REST API exposes the int value instead of the string? It happened in commit 7043 but the reason is not given in the commit message.
But how about we add a
uuid
property to the user object which exposes the original uuid value?
Not sure that's useful, converting it back to an UUID is easy enough ( uuid.UUID(int=value) )
A.
participants (2)
-
Aurelien Bompard
-
Florian Fuchs