*** mjsir911 has joined #novawebdev | 07:56 | |
*** zOnny has joined #novawebdev | 08:24 | |
*** replaceafill has joined #novawebdev | 09:02 | |
*** ubuntourist has joined #novawebdev | 09:11 | |
*** mjsir911 has joined #novawebdev | 09:26 | |
*** mjsir911 has joined #novawebdev | 09:34 | |
*** mjsir911 has joined #novawebdev | 09:48 | |
*** ubuntourist has joined #novawebdev | 11:03 | |
*** zOnny has joined #novawebdev | 11:20 | |
zOnny | hey replaceafill | 11:21 |
---|---|---|
zOnny | can we hang out today ? | 11:21 |
replaceafill | hi zOnny | 11:22 |
replaceafill | zOnny, sure, does 3:00 pm work for you? | 11:22 |
zOnny | 3:10 is the time the class ends. replaceafill | 11:32 |
replaceafill | zOnny, cool, how about 3:30 then? | 11:32 |
zOnny | ok, replaceafill | 11:35 |
*** mr_german has joined #novawebdev | 13:19 | |
*** jelkner has joined #novawebdev | 14:07 | |
jelkner | Good afternoon, replaceafill! (and mr_german, too ;-) | 14:08 |
replaceafill | hey jelkner good afternoon | 14:08 |
jelkner | Do you know which user on #agaric is Micky? | 14:08 |
mr_german | good afternoon jelkner | 14:08 |
replaceafill | jelkner, freescholar | 14:09 |
jelkner | who is Micky-lounger? | 14:09 |
jelkner | i don't see freescholar | 14:09 |
jelkner | but i do see freescholar2 | 14:09 |
replaceafill | jelkner, they have some IRC clients set up i think | 14:09 |
jelkner | i thought that must be it | 14:10 |
replaceafill | jelkner, that's her too i guess | 14:10 |
jelkner | like we have our friend Big_Brother | 14:10 |
replaceafill | jelkner, yep | 14:10 |
jelkner | i filled out the web form for ABC Bookeeping | 14:10 |
jelkner | it costs $175 to talk with them on the phone | 14:11 |
replaceafill | jelkner, :| | 14:11 |
jelkner | and a year of payroll is $5500 | 14:11 |
jelkner | BRAVO has $35K in the bank right now | 14:11 |
jelkner | if we have to spend $5500 for payroll, and then get liability insurance, and ... we will soon be broke | 14:12 |
jelkner | and we won't have done any community organizing :-( | 14:12 |
replaceafill | jelkner, :( | 14:12 |
jelkner | i'll learn a lot through this process that will help us with NOVA Web Development | 14:12 |
replaceafill | jelkner, then we switch to the accounting business ;) | 14:12 |
jelkner | well, maybe we could write that open source system that i found in vaporware yesterday ;-) | 14:13 |
replaceafill | jelkner, lol | 14:13 |
jelkner | anyway, i'm meeting with my friend Khady Lusby for dinner on Friday | 14:13 |
jelkner | i don't know if you know about her? | 14:14 |
replaceafill | jelkner, kind of rings a bell | 14:14 |
jelkner | She started a school in Senegal | 14:14 |
replaceafill | jelkner, is she from africa? | 14:14 |
replaceafill | jelkner, ah yes | 14:14 |
replaceafill | jelkner, i remember her | 14:14 |
jelkner | and a non-profit for it | 14:14 |
replaceafill | jelkner, was it successful? | 14:14 |
jelkner | http://openinternational.org/ | 14:15 |
jelkner | "sucess" is an interesting term | 14:15 |
replaceafill | jelkner, good point :) | 14:16 |
jelkner | her school still exists | 14:16 |
jelkner | and many young Senegalese students have had their lives changed because of it | 14:17 |
replaceafill | jelkner, right | 14:17 |
jelkner | especially poor, rural girls who would not have made it to university otherwise | 14:17 |
jelkner | but it has been a constant struggle for her | 14:17 |
jelkner | with finding good employees, with theft, with state bureaucracy, etc. | 14:18 |
jelkner | anyway, i just called her up. | 14:18 |
jelkner | and said, "Khady, I desperately need help. I'm on the board of a non-profit with almost no money that needs to figure out how to do payroll and keep books." | 14:19 |
jelkner | "I thought to myself, who do I know who is crazy enough to try to do something like that, and I picked up the phone and call you ;=)" | 14:20 |
jelkner | She laughed and told me she would meet me for dinner. | 14:20 |
replaceafill | jelkner, :D | 14:20 |
jelkner | So I'll let you know how it goes. | 14:20 |
replaceafill | jelkner, today i learned jelkner has crazier friends than him ;) | 14:21 |
jelkner | yes he does | 14:21 |
jelkner | actually, Khady is one of my biggest "sheroes". | 14:21 |
replaceafill | jelkner, :) | 14:21 |
jelkner | Like she told me, "I'm like a dog with a bone. No matter what happens, I just hold on and don't let go!" | 14:22 |
jelkner | That's how she is. | 14:22 |
replaceafill | jelkner, nice term | 14:22 |
jelkner | I've often told her how she succeeded where Paco and I failed. | 14:22 |
jelkner | Remind me to tell you more stories when we have the time. | 14:23 |
replaceafill | jelkner, sure | 14:23 |
jelkner | Like the time in Senegal where she refused to pay the customary bribes that are normally need to grease the wheels of government approval for things. | 14:23 |
*** mjsir911 has joined #novawebdev | 14:24 | |
jelkner | Instead, she just sat outside the office and wouldn't leave until she was taken care of (without paying any bribe). | 14:24 |
replaceafill | jelkner, wow | 14:25 |
jelkner | ok, i'll let you get back to work | 14:25 |
jelkner | i'll let you know what i learn on Friday. | 14:25 |
replaceafill | jelkner, please | 14:25 |
replaceafill | jelkner, thanks for sharing | 14:25 |
replaceafill | ACTION goes to get lunch, bb in ~45 | 14:31 |
*** mr_german has joined #novawebdev | 15:17 | |
replaceafill | ACTION is back | 15:17 |
*** zOnny has joined #novawebdev | 15:19 | |
*** mjsir911 has joined #novawebdev | 15:20 | |
jelkner | replaceafill, young master mjsir911 needs your help | 15:20 |
replaceafill | jelkner, ok | 15:21 |
jelkner | apparently, he spent all day Sunday trying to do the helios story the way you asked him to, but could not accomplish the goal | 15:21 |
jelkner | a bit more direction may be a big help to him. | 15:22 |
jelkner | i'll leave it at that | 15:22 |
replaceafill | jelkner, i was expecting on sunday to hear about it | 15:22 |
jelkner | we need to train him to be a bit less self reliant ;-) | 15:22 |
replaceafill | jelkner, that's fine, we need to train him to deal with deadlines | 15:22 |
jelkner | the problem is that he is so much more skilled that i am at this point he knows not to ask me anything | 15:22 |
jelkner | but he should ask you | 15:23 |
replaceafill | jelkner, sure i understand | 15:23 |
replaceafill | jelkner, we just have to highlight the deadlines part | 15:23 |
jelkner | +1 | 15:23 |
replaceafill | mjsir911, i have a hangout with zOnny in 5 minutes, i expect it to last ~30 mins | 15:24 |
replaceafill | mjsir911, i'll be here after that | 15:25 |
mjsir911 | I'll draft up an email regarding the problems ive had | 15:25 |
replaceafill | mjsir911, cool, that works | 15:25 |
replaceafill | mjsir911, it'd be great if you could show some branch too | 15:26 |
mjsir911 | will do | 15:26 |
replaceafill | zOnny, ready? | 15:29 |
zOnny | yep, replaceafill | 15:30 |
mjsir911 | Well replaceafill I've only got what I have up on the gitlab, we can just discuss the issues here | 15:48 |
replaceafill | mjsir911, you mean this: https://gitlab.com/novawebdevelopment/helios-nova/tree/feature/embeddedtokens | 15:50 |
mjsir911 | yep thats the one, I didnt realize how close of a name it has to the other branch, but I'll move the other branch somewhere else later | 15:50 |
replaceafill | mjsir911, ok | 15:51 |
mjsir911 | So my biggest problem that I was experiencing was that the post_save hook was not being called for all the models | 15:51 |
mjsir911 | including the Voter model, the one that I wanted to modify | 15:51 |
replaceafill | mjsir911, does that work now? | 15:52 |
mjsir911 | No I couldn't figure out how to modify the Voter model on any events | 15:53 |
replaceafill | mjsir911, ok | 15:53 |
replaceafill | mjsir911, give me a second i'm recollecting all our communication on this | 15:53 |
mjsir911 | yea ok | 15:53 |
replaceafill | mjsir911, did i point you at signals some time in the past? i can't find that... | 15:55 |
mjsir911 | I thought you did, but looking I can't either | 15:55 |
mjsir911 | oh, therees an issue on gitlab... | 15:55 |
replaceafill | ah yeah | 15:55 |
replaceafill | mjsir911, got it | 15:55 |
replaceafill | mjsir911, i have to admit i get lost in all those projects now.... cc jelkner :( | 15:56 |
replaceafill | mjsir911, it's here https://gitlab.com/novawebdevelopment/helios-aea/issues/2 | 15:56 |
mjsir911 | thanks | 15:56 |
replaceafill | mjsir911, so you need to register your signal handlers | 15:56 |
replaceafill | mjsir911, let me look for an example how to do that | 15:57 |
mjsir911 | yes, and at one point I used the AppConfig method but I recall that not working so I removed that, but I will do that again | 15:57 |
replaceafill | mjsir911, ok | 15:57 |
replaceafill | mjsir911, yes | 15:57 |
replaceafill | mjsir911, see: https://gitlab.com/novawebdevelopment/event-attendance/blob/master/__init__.py | 15:57 |
replaceafill | the default_app_config is what django looks for | 15:58 |
replaceafill | mjsir911, then you implement it like this: https://gitlab.com/novawebdevelopment/event-attendance/blob/master/apps.py | 15:58 |
replaceafill | mjsir911, that's how your handlers are registered | 15:58 |
mjsir911 | give me a second to push what I currently have | 15:59 |
replaceafill | mjsir911, ok | 15:59 |
mjsir911 | so what I currently have now I thought would work, but the class_prepared signal is not being fired for some reason | 16:04 |
replaceafill | mjsir911, did you add the helios-nova directory to the settings.INSTALLED_APPS? | 16:06 |
mjsir911 | yes I did, but I renamed the directory to `tokens` to go along with the paths in the repository | 16:06 |
replaceafill | mjsir911, well in your case the app directory should be called "tokens" | 16:06 |
replaceafill | mjsir911, ok | 16:07 |
mjsir911 | I've traced the path of execution and it seems to be stopping at the import in the ready function in the AppConfig object | 16:07 |
mjsir911 | It's printing stuff out when I put a print in the ready() function, but not when I put a print in the signals file | 16:08 |
replaceafill | mjsir911, let me try to set it up | 16:11 |
mjsir911 | ok yea | 16:11 |
mjsir911 | I found the problem, changing `import tokens.signals` to `import signals` seemed to run code in the signals file | 16:16 |
replaceafill | mjsir911, ah ok | 16:16 |
replaceafill | mjsir911, maybe there's something else called tokens | 16:16 |
replaceafill | mjsir911, i think we should keep the helios-nova anyway | 16:17 |
mjsir911 | yea and the relative import should have no problem? | 16:17 |
replaceafill | mjsir911, and maybe relabel it to helios_nova | 16:17 |
mjsir911 | oh yea thats a good idea | 16:17 |
replaceafill | mjsir911, i was going to do that before deployment but i didn't want to mess with your checkouts | 16:18 |
replaceafill | mjsir911, so does it work now? | 16:18 |
mjsir911 | well it is importing the signals file | 16:18 |
mjsir911 | And on to the first problem: the `voter_add_field` function + signal dont work if called by the ready() function, because the Voter model is already created | 16:18 |
mjsir911 | The easy fix for this is to just put that function in __init__.py | 16:19 |
replaceafill | mjsir911, ok, now that the signals are being picked up let me check what the handler is doing | 16:19 |
replaceafill | mjsir911, ok, we're talking this right: https://gitlab.com/novawebdevelopment/helios-nova/blob/feature/embeddedtokens/signals.py | 16:20 |
mjsir911 | yes, the first function there | 16:20 |
replaceafill | mjsir911, you don't really want to be modifying any helios model there | 16:21 |
replaceafill | mjsir911, you want your own model in your app | 16:21 |
mjsir911 | In a seperate table then? | 16:21 |
replaceafill | mjsir911, so add a new model just with the token field | 16:22 |
replaceafill | mjsir911, yes | 16:22 |
replaceafill | mjsir911, i mean | 16:22 |
replaceafill | mjsir911, you could reuse the table | 16:22 |
replaceafill | mjsir911, but at this point it's too much effort for so small payofff | 16:22 |
*** zOnny has joined #novawebdev | 16:22 | |
mjsir911 | Yea ok, I got it to be able to modify the voter class, but having my own models isnt a big deal | 16:22 |
replaceafill | mjsir911, so the postsave reacts either on creation or modification of the Voter objects | 16:23 |
replaceafill | mjsir911, so you need to detect what happened | 16:24 |
mjsir911 | but the problem is, it doesnt | 16:24 |
mjsir911 | let me run through creating an election and put the output of those print()s somewhere | 16:24 |
replaceafill | mjsir911, ok | 16:24 |
replaceafill | mjsir911, remember to run "manage.py makemigrations" and "manage.py migrate" after you add your model | 16:26 |
mjsir911 | yep, I think I'll do the models later because I don't have any critical problems with them right now | 16:26 |
mjsir911 | the problem I was having was that only some helios models were causing the post_save signal | 16:26 |
replaceafill | mjsir911, ok | 16:27 |
mjsir911 | link to runserver output here: https://pastebin.com/Ed4FD3F8 | 16:32 |
mjsir911 | the test_post_save function puts the arguments & sender around stars *** | 16:32 |
replaceafill | mjsir911, is there an exception in here? | 16:33 |
replaceafill | mjsir911, it's difficult to see with all the sql debug log | 16:34 |
mjsir911 | I don't think theres an exception anywhere | 16:34 |
replaceafill | mjsir911, so you're saying the handler gets called? | 16:35 |
mjsir911 | just not for the Voter objects | 16:35 |
replaceafill | mjsir911, can you push your latest code? | 16:35 |
mjsir911 | sure | 16:35 |
mjsir911 | pushed | 16:37 |
replaceafill | mjsir911, you uploaded the voter as csv file? | 16:42 |
mjsir911 | yes, is there another way to do it? | 16:42 |
replaceafill | mjsir911, no i was just checking | 16:42 |
replaceafill | mjsir911, i'm starting to think the celery worker doesn't trigger the signal | 16:43 |
replaceafill | mjsir911, csv are processed as celery tasks | 16:43 |
replaceafill | mjsir911, and the voter object is created then | 16:43 |
mjsir911 | I see | 16:43 |
mjsir911 | I think it could be possible to access the voter objects through VoterFile save or Election save | 16:45 |
replaceafill | mjsir911, i was thinking the voter file too | 16:45 |
mjsir911 | The only problem I had with using voterfile was iterVoters() returns voterID, name and email, but not the election | 16:47 |
mjsir911 | What is the voter ID? Should I worry about colliding voter ids? | 16:47 |
replaceafill | mjsir911, the election is a foreign key | 16:47 |
replaceafill | mjsir911, i mean, in the voter file | 16:47 |
mjsir911 | I couldn't find a way to access it | 16:48 |
replaceafill | mjsir911, yeah the problem i see at doing it at that level is that you would need to reproduce most of the "def process" logic | 16:48 |
mjsir911 | self.election, to the best of my knowledge, returned an Election.None | 16:48 |
replaceafill | mjsir911, it should be self.election, see the process method | 16:49 |
replaceafill | mjsir911, maybe the object hasn't been saved yet when you checked | 16:50 |
replaceafill | hadn't* | 16:50 |
mjsir911 | Give me a second to test this out | 16:51 |
replaceafill | mjsir911, ok | 16:52 |
mjsir911 | Well it doesnt seem to be an election none object, is there any way for me to get all the voters from an election easily to test? | 16:53 |
replaceafill | mjsir911, from the election? the voter_set | 16:54 |
replaceafill | mjsir911, each voter has a foreign key | 16:55 |
replaceafill | mjsir911, to the election | 16:55 |
replaceafill | mjsir911, you can access the relationship the other way using model name in lower case + "_set" | 16:55 |
mjsir911 | huh? | 16:56 |
replaceafill | mjsir911, election.voter_set should give you all the voter objects attached to it | 16:56 |
mjsir911 | Oh yea heres the problem: kwargs['instance'].election.voter_set returns helios.Voter.None | 16:57 |
replaceafill | mjsir911, what's kwargs['created'] at that point? True? | 16:57 |
mjsir911 | yes | 16:58 |
mr_german | replaceafill, one question, you'll be around at night? | 16:58 |
mjsir911 | {'update_fields': None, 'instance': <VoterFile: VoterFile object>, 'signal': <django.db.models.signals.ModelSignal object at 0x7efe6a3516d0>, 'created': True, 'raw': False, 'using': 'default'} | 16:58 |
replaceafill | mjsir911, that means the object hasn't been saved yet | 16:58 |
replaceafill | mjsir911, so the relationships haven't been fully stablished yet | 16:58 |
replaceafill | mr_german, no | 16:58 |
mjsir911 | what would you suggest? | 17:00 |
replaceafill | mjsir911, i really don't want us to reproduce the "check if this voter exists" of the "process" method in the voterfile | 17:01 |
mr_german | ACTION *sign off* | 17:01 |
mjsir911 | I could very well just regenerate a token if a user is created | 17:01 |
mjsir911 | even if they exist | 17:02 |
replaceafill | mjsir911, user? | 17:02 |
mjsir911 | Voter, sorry | 17:02 |
replaceafill | mjsir911, how would you catch that from outside helios? | 17:02 |
mjsir911 | iterVoters() returns voter IDs successfully from the VoterFile | 17:03 |
replaceafill | mjsir911, depending at the point you iterate that you can have the same issue with the election being None | 17:05 |
replaceafill | mjsir911, i mean the voter not being really saved yet | 17:06 |
mjsir911 | hmmm yea | 17:06 |
replaceafill | mjsir911, remind me something | 17:12 |
replaceafill | mjsir911, no wait | 17:12 |
replaceafill | mjsir911, can you try this: | 17:12 |
replaceafill | mjsir911, define the connect without the reeiver decorator | 17:13 |
replaceafill | post_save.connect( | 17:13 |
replaceafill | test_post_save, | 17:13 |
replaceafill | sender=Voter, | 17:13 |
replaceafill | weak=False, | 17:13 |
replaceafill | ) | 17:13 |
mjsir911 | what does the weak keyword argument do | 17:14 |
mjsir911 | and should I do sender=Voter or sender='helios.Voter' | 17:14 |
replaceafill | mjsir911, i can get to the Voter model in the handler | 17:14 |
replaceafill | mjsir911, no Voter class | 17:14 |
replaceafill | mjsir911, not string | 17:14 |
mjsir911 | Thats not working for me :/ | 17:17 |
replaceafill | mjsir911, do you have celery working in a different terminal? | 17:18 |
replaceafill | mjsir911, check the celery log | 17:18 |
mjsir911 | same terminal in background | 17:18 |
replaceafill | mjsir911, not the server | 17:18 |
replaceafill | mjsir911, i think you're just not catching the right debug info | 17:19 |
mjsir911 | I wasn't checking there, give me a second | 17:19 |
mjsir911 | Not working for me | 17:23 |
mjsir911 | could you push the changes you've made? | 17:23 |
replaceafill | mjsir911, i just reverted them | 17:23 |
replaceafill | mjsir911, but here's my output from celery | 17:24 |
replaceafill | mjsir911, https://pastebin.com/yBLGmErs | 17:24 |
replaceafill | mjsir911, see line 11 and 15 | 17:24 |
mjsir911 | Yea I see, let me do the same | 17:25 |
mjsir911 | what are you running to start celery? | 17:25 |
replaceafill | mjsir911, manage.py celery worker | 17:25 |
replaceafill | mjsir911, i changed the set up shared doc we have recently | 17:26 |
replaceafill | mjsir911, i hope i didn't break it | 17:26 |
replaceafill | mjsir911, i'll need to leave in 5 mins | 17:34 |
mjsir911 | ok, I think you've given me what I need to continue | 17:35 |
replaceafill | mjsir911, were you able to see the Voter model in the logs? | 17:35 |
mjsir911 | Yep, I see it | 17:35 |
replaceafill | mjsir911, great | 17:35 |
replaceafill | mjsir911, so you can continue with your same approach | 17:35 |
mjsir911 | How is the idea of modifying the voter model to include a token? | 17:35 |
mjsir911 | Because I think I did get that working, just scrapped it because nothing else was working | 17:36 |
replaceafill | mjsir911, you don't modify it | 17:36 |
replaceafill | mjsir911, create a separate model under our app | 17:36 |
replaceafill | mjsir911, don't touch helios | 17:36 |
mjsir911 | ok | 17:36 |
replaceafill | mjsir911, just sync it by election + voter id | 17:36 |
mjsir911 | I mean modifying it through the signals though | 17:36 |
mjsir911 | not through changing the source code, but alright | 17:37 |
replaceafill | mjsir911, you just get data from the voter object | 17:37 |
replaceafill | mjsir911, no that's what i mean | 17:37 |
replaceafill | mjsir911, you don't need to modify the voter object | 17:37 |
replaceafill | mjsir911, just to retrieve the voter id | 17:37 |
mjsir911 | ok yea, make our own models in our own tables | 17:37 |
replaceafill | mjsir911, and the middleware just checks if the election + voter combination exists | 17:38 |
replaceafill | mjsir911, ok, shoot me an email if you get stuck | 17:38 |
replaceafill | mjsir911, or a merge request instead ;) | 17:38 |
replaceafill | mjsir911, thanks for working on this | 17:38 |
replaceafill | mjsir911, and sorry for the overhead | 17:39 |
replaceafill | mjsir911, but it's the clean approach we really want | 17:39 |
replaceafill | ACTION signs off | 17:39 |
jelkner | ACTION signs off | 18:00 |
*** mjsir911 has joined #novawebdev | 21:09 | |
*** mjsir911 has joined #novawebdev | 22:07 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!