*** tpb has joined #melange | 00:00 | |
Robert_S | madrazr: Do you have an example of loading a user object that works? When I'm doing it, I'm getting errors, even if I call user() on a profile | 00:15 |
---|---|---|
Robert_S | BadValueError: Property status is 1L; must be one of ['valid', 'invalid'] | 00:17 |
madrazr | Robert_S: For user entities use NDB API. User model is an NDB model now | 00:38 |
madrazr | Robert_S: example of fetching an entity is : User.get_by_id("<username>") | 00:38 |
madrazr | where User is imported as from melange.models.user import User | 00:39 |
*** Abhishek_ has joined #melange | 00:45 | |
Robert_S | madrazr: | 00:45 |
Robert_S | what's username supposed to be? | 00:46 |
Robert_S | >>> User | 00:47 |
Robert_S | <class 'soc.models.user.User'> | 00:47 |
Robert_S | >>> User.get_by_id("carols") | 00:47 |
Robert_S | BadArgumentError: Expected an instance or iterable of (<type 'int'>, <type 'long'>); received carols (a str). | 00:47 |
madrazr | Robert_S: Username is what the users choose when they create their account on Melange | 00:51 |
madrazr | Robert_S: historically it has also been known as link_id | 00:51 |
Robert_S | I thought that was a profile attribute. | 00:51 |
madrazr | so you may be see those two terms being used interchangeably | 00:51 |
madrazr | Robert_S: we replicate it | 00:51 |
madrazr | Robert_S: but it is unique to the User entity | 00:52 |
madrazr | Robert_S: each profile will have a copy of the value | 00:52 |
Robert_S | get_by_id wants an int. | 00:52 |
madrazr | Robert_S: also btw your User class is pointing to an obsolete DB API based User model | 00:52 |
madrazr | Robert_S: you should import from melange.models.user import User | 00:52 |
Robert_S | Aha. | 00:53 |
Robert_S | Why is soc.models.user still around? | 00:53 |
madrazr | Robert_S: NDB migration is a W.I.P. | 00:53 |
Robert_S | I thought it was being done a type at a time | 00:53 |
madrazr | Robert_S: we haven't made really that far to remove DB API model definitions | 00:54 |
madrazr | just in case | 00:54 |
madrazr | Robert_S: correct | 00:54 |
*** asmeurer_ has quit IRC | 00:54 | |
Robert_S | Ok, so just the cleanup isn't done. If I remember, I'll drop a OBSOLETE note in that file. | 00:54 |
madrazr | Robert_S: new NDB models corresponding to old DB models are being introduced one by one | 00:54 |
madrazr | but we are not removing the old models yet | 00:54 |
madrazr | rather, we haven't | 00:54 |
madrazr | Robert_S: it is not just about cleanup in code | 00:55 |
madrazr | Robert_S: there is also data | 00:55 |
madrazr | Robert_S: which is the hesitation behind deleting the model definitions | 00:55 |
* Robert_S nods. | 00:55 | |
Robert_S | Hence just putting a big comment in the code. | 00:56 |
madrazr | Robert_S: for sure, please add that note in the files | 00:56 |
madrazr | it will be useful | 00:56 |
madrazr | Robert_S: yeah, definitely. +1 for that | 00:56 |
madrazr | Robert_S: I am wondering if we can have a common way to throw a warning everytime it is accessed | 00:56 |
madrazr | Robert_S: shouldn't be hard | 00:56 |
madrazr | we can wrap all the accesses on the model into __getattr__ magic I guess, which in prints a warning | 00:57 |
* Robert_S nods. | 01:01 | |
Robert_S | r.host_for.append(ndb.Key('GSoCProgram', 'google/gsoc2014')) | 01:01 |
Robert_S | Yay! | 01:01 |
Robert_S | Maybe that wasn't worth it, but I learned useful things. | 01:03 |
Robert_S | I will eventually get the hang of this. | 01:05 |
*** asmeurer has joined #melange | 01:05 | |
madrazr | Robert_S: yeah, for sure | 01:09 |
madrazr | Robert_S: also, I think it is useful to know how to do this | 01:10 |
Robert_S | It definitely is. | 01:10 |
*** meflin has quit IRC | 01:21 | |
*** meflin has joined #melange | 01:23 | |
*** meflin has quit IRC | 01:31 | |
*** meflin has joined #melange | 01:32 | |
*** meflin has quit IRC | 01:59 | |
*** meflin has joined #melange | 02:00 | |
*** ArneBab has joined #melange | 02:05 | |
*** meflin_ has joined #melange | 02:06 | |
*** meflin has quit IRC | 02:06 | |
*** ArneBab_ has quit IRC | 02:08 | |
*** meflin_ has quit IRC | 02:16 | |
*** meflin__ has joined #melange | 02:17 | |
*** tkamppeter has quit IRC | 02:20 | |
*** tkamppeter has joined #melange | 02:23 | |
*** meflin__ has quit IRC | 02:49 | |
*** Gentlecat has quit IRC | 03:32 | |
*** saurabhsood91 has quit IRC | 04:11 | |
*** asmeurer has quit IRC | 04:35 | |
*** madrazr has quit IRC | 05:45 | |
*** Abhishek_ has quit IRC | 06:50 | |
*** Abhishek_ has joined #melange | 07:12 | |
*** suranga has quit IRC | 07:31 | |
*** AnujSharma has joined #melange | 07:46 | |
*** samgtr has joined #melange | 08:18 | |
*** madrazr has joined #melange | 08:21 | |
*** ChanServ sets mode: +o madrazr | 08:21 | |
*** rocker has quit IRC | 08:26 | |
*** AnujSharma has quit IRC | 08:54 | |
*** Darrel has quit IRC | 09:18 | |
*** Darrel has joined #melange | 09:18 | |
*** Gentlecat has joined #melange | 09:40 | |
*** Darrel has quit IRC | 09:46 | |
*** Darrel has joined #melange | 09:48 | |
*** penguinRaider has quit IRC | 10:01 | |
*** penguinRaider has joined #melange | 10:18 | |
*** rocker has joined #melange | 10:29 | |
*** samgtr has quit IRC | 10:46 | |
*** mang0 has joined #melange | 10:58 | |
*** mang0 has joined #melange | 10:58 | |
*** mang0 has quit IRC | 11:03 | |
*** mang0 has joined #melange | 11:04 | |
*** mang0 has joined #melange | 11:04 | |
*** madrazr has quit IRC | 11:16 | |
*** Abhishek_ has quit IRC | 11:30 | |
*** Abhishek_ has joined #melange | 11:46 | |
*** penguinRaider has quit IRC | 11:47 | |
*** rocker has quit IRC | 11:47 | |
*** AnujSharma has joined #melange | 11:49 | |
*** penguinRaider has joined #melange | 12:03 | |
*** rocker has joined #melange | 12:03 | |
*** karanp has joined #melange | 12:37 | |
*** saurabhsood91 has joined #melange | 13:28 | |
*** suranga has joined #melange | 13:48 | |
*** carols has joined #melange | 14:03 | |
*** samgtr has joined #melange | 14:14 | |
*** AnujSharma has quit IRC | 14:14 | |
*** Abhishek_ has quit IRC | 14:20 | |
*** asmeurer has joined #melange | 14:56 | |
*** asmeurer has quit IRC | 14:57 | |
*** AnujSharma has joined #melange | 15:07 | |
*** AnujSharma has quit IRC | 15:19 | |
*** meflin__ has joined #melange | 15:21 | |
*** AnujSharma has joined #melange | 16:01 | |
*** Abhishek_ has joined #melange | 16:01 | |
*** Slurpee has joined #melange | 16:15 | |
Slurpee | How does one edit documentation in Melange? <- (org admin with recently finished students available to help update info) | 16:16 |
*** meflin__ has left #melange | 16:16 | |
*** cs_shadow has joined #melange | 16:17 | |
*** rocker has quit IRC | 16:19 | |
*** AnujSharma has quit IRC | 16:23 | |
*** samgtr has quit IRC | 16:26 | |
*** rocker has joined #melange | 16:45 | |
*** samgtr has joined #melange | 16:52 | |
*** AnujSharma has joined #melange | 16:52 | |
*** AnujSharma has quit IRC | 17:13 | |
*** AnujSharma has joined #melange | 17:32 | |
*** saurabhsood91 has quit IRC | 17:38 | |
*** saurabhsood91 has joined #melange | 17:39 | |
*** saurabhsood91 has joined #melange | 17:39 | |
*** Slurpee has quit IRC | 17:55 | |
*** asmeurer has joined #melange | 18:00 | |
*** robbyoconnor has quit IRC | 18:03 | |
*** asmeurer has quit IRC | 18:05 | |
Robert_S | Slurpee: You're gone, but if you come back, please be more specific about which documentation. | 18:18 |
*** rigelk has joined #melange | 18:24 | |
*** shikher has joined #melange | 18:40 | |
*** shikher has quit IRC | 18:41 | |
*** samgtr has quit IRC | 19:06 | |
*** karanp has left #melange | 19:14 | |
*** robbyoconnor has joined #melange | 19:15 | |
*** samgtr has joined #melange | 19:24 | |
*** AnujSharma has quit IRC | 19:24 | |
*** asmeurer has joined #melange | 19:25 | |
*** robbyoconnor has quit IRC | 19:28 | |
*** robbyoconnor has joined #melange | 19:28 | |
*** Abhishek_ has quit IRC | 19:30 | |
*** robbyoconnor has quit IRC | 19:30 | |
*** madrazr has joined #melange | 19:44 | |
*** ChanServ sets mode: +o madrazr | 19:44 | |
*** hammad_ has joined #melange | 19:52 | |
*** carols has quit IRC | 20:11 | |
*** carols has joined #melange | 20:14 | |
*** carols has quit IRC | 20:49 | |
*** cs_shadow is now known as cs_shadow|afk | 21:20 | |
*** samgtr has quit IRC | 21:36 | |
*** rigelk has quit IRC | 21:39 | |
*** rigelk has joined #melange | 21:57 | |
*** hammad_ has quit IRC | 22:22 | |
*** asmeurer has joined #melange | 22:46 | |
*** asmeurer has quit IRC | 22:49 | |
*** asmeurer has joined #melange | 22:53 | |
*** asmeurer has quit IRC | 23:19 | |
*** asmeurer has joined #melange | 23:21 |
Generated by irclog2html.py 2.12.1 by Marius Gedminas - find it at mg.pov.lt!