From wereapwhatwesow at gmail.com Thu Jun 7 21:54:14 2012 From: wereapwhatwesow at gmail.com (Steve Young) Date: Thu, 7 Jun 2012 14:54:14 -0500 Subject: [omaha] Django question Message-ID: Hey Guys, I am trying to create a flashcard web app. There is a python open source flashcard program called Anki that the author has made available, and has also conveniently separated the backend code. I would like to use it's library code if possible. It loads the flashcard decks, has spaced repetition, stats, and many other nice features. But it was created for a desktop app - not a web app with many users connecting at the same time (although no deck will be accessed concurrently). I have been able to create a django project, load the anki code into it as app, and create a page loading a sample deck. I am not sure the best way to proceed in making this work for multi-users, or even if this is a good idea. Since I am not using django models (the anki code uses sqlite3 db's, one for each deck) I am not sure how to proceed (all the books and docs I have studied have been using django models). Any ideas, tips, links?? Thanks. Steve From jeffh at dundeemt.com Thu Jun 7 23:39:54 2012 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Thu, 7 Jun 2012 16:39:54 -0500 Subject: [omaha] Django question In-Reply-To: References: Message-ID: So I took a quick look ath libanki specifically, the storage module https://github.com/dae/libanki/blob/master/anki/storage.py It appears to be built assuming individual usage, correct? So there are a couple things you need to look at first. 1) Check the licensing -- https://github.com/dae/libanki/blob/master/LICENSE do you accept the terms of the license? Really important to understand the implications. AGPL3 I'm not saying there is a problem it is open, but requires your code that implements it to be open too. 2) Change of perspective for the db. Currently its world view is, "my sock drawer." If you want to put socks in, build your own drawer. Eventually there will be too many sock drawers and you have to manage them too. You are going to have to change its world view to "Our sock drawer." This is going to require you to modify table structures and the associated code for accessing the socks. Currently you have something like: SockColor SockLength SockClean You will want to modify that structure to add the socks owner (or userid) so more than 1 person can have socks in the sock drawer. UserId SockColor SockLength SockClean So, where before you would say, get me a red sock, mySock = getSock(red) now you have to qualify your request with get me Jeff's red sock. mysock = getSock(Jeff, red) Once you have your sock, You can still washSock(mySock) or mySock.wash() but the sock now has owner information. This way you end up with a single sock drawer that can hold everyone's socks. Since you have to do modify the db structure, you might as well implement it django models and then just modify storage.py as needed. In the end, this means you are going to get very intimate with the anki db structure. How easy it is to decouple the storage from the rest of the code depends on how well the original code is abstracted/organized. _addSchema appears to use 5 tables. So this is not a pipe dream. Have Fun! -Jeff On Thu, Jun 7, 2012 at 2:54 PM, Steve Young wrote: > Hey Guys, > > I am trying to create a flashcard web app. There is a python open source > flashcard program called Anki that the author has made available, and has > also conveniently separated the backend code. I would like to use it's > library code if possible. It loads the flashcard decks, has spaced > repetition, stats, and many other nice features. But it was created for a > desktop app - not a web app with many users connecting at the same time > (although no deck will be accessed concurrently). > > I have been able to create a django project, load the anki code into it as > app, and create a page loading a sample deck. I am not sure the best way > to proceed in making this work for multi-users, or even if this is a good > idea. Since I am not using django models (the anki code uses sqlite3 db's, > one for each deck) I am not sure how to proceed (all the books and docs I > have studied have been using django models). > > Any ideas, tips, links?? > > Thanks. > > Steve > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Best, Jeff Hinrichs 402.218.1473 From mike at hostetlerhome.com Thu Jun 7 23:30:28 2012 From: mike at hostetlerhome.com (Mike Hostetler) Date: Thu, 7 Jun 2012 16:30:28 -0500 Subject: [omaha] Django question In-Reply-To: References: Message-ID: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> You don't have a choice -- you have to use Django models to access the database. There may be a way around it (use Django for views and Anki db for database access) but then you are using heavy-weight Django with a by-pass. So you may have to deal with Django's problems and not reap any of it's benefits. Maybe try web.py or Flask. They are supposed to be lighter-weight. They could handle the web portion and you could roll our own (or use Anki's) db backend. Steve Young wrote: > Hey Guys, > > I am trying to create a flashcard web app. There is a python open source > flashcard program called Anki that the author has made available, and has > also conveniently separated the backend code. I would like to use it's > library code if possible. It loads the flashcard decks, has spaced > repetition, stats, and many other nice features. But it was created for a > desktop app - not a web app with many users connecting at the same time > (although no deck will be accessed concurrently). > > I have been able to create a django project, load the anki code into it as > app, and create a page loading a sample deck. I am not sure the best way > to proceed in making this work for multi-users, or even if this is a good > idea. Since I am not using django models (the anki code uses sqlite3 > db's, > one for each deck) I am not sure how to proceed (all the books and docs I > have studied have been using django models). > > Any ideas, tips, links?? > > Thanks. > > Steve > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From mike at hostetlerhome.com Thu Jun 7 23:30:26 2012 From: mike at hostetlerhome.com (Mike Hostetler) Date: Thu, 7 Jun 2012 16:30:26 -0500 Subject: [omaha] Django question In-Reply-To: References: Message-ID: <303bc9bc4a82b66f88349af41f042552.squirrel@email.powweb.com> You don't have a choice -- you have to use Django models to access the database. There may be a way around it (use Django for views and Anki db for database access) but then you are using heavy-weight Django with a by-pass. So you may have to deal with Django's problems and not reap any of it's benefits. Maybe try web.py or Flask. They are supposed to be lighter-weight. They could handle the web portion and you could roll our own (or use Anki's) db backend. Steve Young wrote: > Hey Guys, > > I am trying to create a flashcard web app. There is a python open source > flashcard program called Anki that the author has made available, and has > also conveniently separated the backend code. I would like to use it's > library code if possible. It loads the flashcard decks, has spaced > repetition, stats, and many other nice features. But it was created for a > desktop app - not a web app with many users connecting at the same time > (although no deck will be accessed concurrently). > > I have been able to create a django project, load the anki code into it as > app, and create a page loading a sample deck. I am not sure the best way > to proceed in making this work for multi-users, or even if this is a good > idea. Since I am not using django models (the anki code uses sqlite3 > db's, > one for each deck) I am not sure how to proceed (all the books and docs I > have studied have been using django models). > > Any ideas, tips, links?? > > Thanks. > > Steve > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From shawnhermans at gmail.com Fri Jun 8 02:52:57 2012 From: shawnhermans at gmail.com (Shawn Hermans) Date: Thu, 7 Jun 2012 19:52:57 -0500 Subject: [omaha] Django question In-Reply-To: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> References: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> Message-ID: I am going to start off by saying I am probably guessing on what you are trying to do. From the sounds of it you have a bunch of flash cards that are stored in a single or multiple SQLite databases. You want to make these flash cards web accessible. What I am not clear on is whether you want users to be able to customize flash cards or you want them to be able to use pre-canned flash card sets. All that being said, one idea is to store the flash cards on disk and use a Django filefield to access the stored database. Below is a quick example of a Django model. I am going off memory and so I wouldn't trust this code. Plus the indentation probably is off too. class FlashCard(models.Model): sqlitedb = FileField() name = CharField() description = CharField() user = ForeignKey(User) Alternatively, you could store the SQLite database as a binary object within your database. Here is a recipe for creating a blob field using base64 encoding http://djangosnippets.org/snippets/1597/. I am not saying these are the most elegant solutions out there, but they have a chance of working. If that doesn't work, try duct tape. That always seems to work for me. Cheers, Shawn I can only guess to the impacts to performance using this type of approach. My guess is you would be okay as long as the SQLite databases are small and change infrequently. If they are relatively static, you should be able to use Django's cache framework to cache the files and not need to hit the DB or the file system. On Thu, Jun 7, 2012 at 4:30 PM, Mike Hostetler wrote: > > You don't have a choice -- you have to use Django models to access the > database. There may be a way around it (use Django for views and Anki db > for database access) but then you are using heavy-weight Django with a > by-pass. So you may have to deal with Django's problems and not reap any > of it's benefits. > > Maybe try web.py or Flask. They are supposed to be lighter-weight. They > could handle the web portion and you could roll our own (or use Anki's) db > backend. > > > > Steve Young wrote: > > Hey Guys, > > > > I am trying to create a flashcard web app. There is a python open source > > flashcard program called Anki that the author has made available, and has > > also conveniently separated the backend code. I would like to use it's > > library code if possible. It loads the flashcard decks, has spaced > > repetition, stats, and many other nice features. But it was created for a > > desktop app - not a web app with many users connecting at the same time > > (although no deck will be accessed concurrently). > > > > I have been able to create a django project, load the anki code into it > as > > app, and create a page loading a sample deck. I am not sure the best way > > to proceed in making this work for multi-users, or even if this is a good > > idea. Since I am not using django models (the anki code uses sqlite3 > > db's, > > one for each deck) I am not sure how to proceed (all the books and docs I > > have studied have been using django models). > > > > Any ideas, tips, links?? > > > > Thanks. > > > > Steve > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From wereapwhatwesow at gmail.com Tue Jun 12 23:58:21 2012 From: wereapwhatwesow at gmail.com (Steve Young) Date: Tue, 12 Jun 2012 16:58:21 -0500 Subject: [omaha] Django question In-Reply-To: References: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> Message-ID: Thanks to everyone for the comments and suggestions!! Firstly, Mike > There may be a way around it (use Django for views and Anki db for > database access) This is what I am attempting. More of a proof of concept, with converting to Django models later (maybe)... I am using Django auth for users and permissions. Jeff and Shawn - > From the sounds of it you have a bunch of flash cards that are stored in a > single or multiple SQLite databases. You want to make these flash cards > web accessible. What I am not clear on is whether you want users to be > able to customize flash cards or you want them to be able to use > pre-canned flash card sets. So 1 SQLite database per deck, and the ability to create and edit decks. Each user will have his own decks. I am thinking about trying the FileField approach to associate the users with their decks. Encoding is overkill at the moment, but I might try it, as it would be useful if I ever deploy this publicly. BUT back to my original question about multi-user - the error I was getting originally when trying to open 2 decks at once was a file in use error - I was mistakenly trying to open the same deck/db file in each instance. So I corrected this, and am able to open 2 different decks/files at the same time. So in the load_deck view, I create a deck and render it in the template: def load_deck(request): from anki.deck import DeckStorage deck = DeckStorage.Deck('media/test10.anki') return render(request, 'flfanki/load_deck.html', { 'deck': deck }) I now need to be able to have a link in the rendered template that says something like - I am finished studying - and pulls up the close_deck view and closes the deck. But how do I pass the deck object into the view so it knows which deck to close? I tried adding the deck to request object: request.session['deckObject'] = deck but get an error saying you can't pickle an instancemethod. Or if I implement the FileField approach, will that help with the issue? I am stuck once again... Steve On Thu, Jun 7, 2012 at 7:52 PM, Shawn Hermans wrote: > I am going to start off by saying I am probably guessing on what you are > trying to do. From the sounds of it you have a bunch of flash cards that > are stored in a single or multiple SQLite databases. You want to make > these flash cards web accessible. What I am not clear on is whether you > want users to be able to customize flash cards or you want them to be able > to use pre-canned flash card sets. > > All that being said, one idea is to store the flash cards on disk and use a > Django filefield to access the stored database. Below is a quick example > of a Django model. I am going off memory and so I wouldn't trust this > code. Plus the indentation probably is off too. > > class FlashCard(models.Model): > sqlitedb = FileField() > name = CharField() > description = CharField() > user = ForeignKey(User) > > Alternatively, you could store the SQLite database as a binary object > within your database. Here is a recipe for creating a blob field using > base64 encoding > http://djangosnippets.org/snippets/1597/. > > I am not saying these are the most elegant solutions out there, but they > have a chance of working. If that doesn't work, try duct tape. That always > seems to work for me. > > Cheers, > Shawn > > I can only guess to the impacts to performance using this type of approach. > My guess is you would be okay as long as the SQLite databases are small and > change infrequently. If they are relatively static, you should be able to > use Django's cache framework to cache the files and not need to hit the DB > or the file system. > > > > On Thu, Jun 7, 2012 at 4:30 PM, Mike Hostetler >wrote: > > > > > You don't have a choice -- you have to use Django models to access the > > database. There may be a way around it (use Django for views and Anki db > > for database access) but then you are using heavy-weight Django with a > > by-pass. So you may have to deal with Django's problems and not reap any > > of it's benefits. > > > > Maybe try web.py or Flask. They are supposed to be lighter-weight. They > > could handle the web portion and you could roll our own (or use Anki's) > db > > backend. > > > > > > > > Steve Young wrote: > > > Hey Guys, > > > > > > I am trying to create a flashcard web app. There is a python open > source > > > flashcard program called Anki that the author has made available, and > has > > > also conveniently separated the backend code. I would like to use it's > > > library code if possible. It loads the flashcard decks, has spaced > > > repetition, stats, and many other nice features. But it was created > for a > > > desktop app - not a web app with many users connecting at the same time > > > (although no deck will be accessed concurrently). > > > > > > I have been able to create a django project, load the anki code into it > > as > > > app, and create a page loading a sample deck. I am not sure the best > way > > > to proceed in making this work for multi-users, or even if this is a > good > > > idea. Since I am not using django models (the anki code uses sqlite3 > > > db's, > > > one for each deck) I am not sure how to proceed (all the books and > docs I > > > have studied have been using django models). > > > > > > Any ideas, tips, links?? > > > > > > Thanks. > > > > > > Steve > > > _______________________________________________ > > > Omaha Python Users Group mailing list > > > Omaha at python.org > > > http://mail.python.org/mailman/listinfo/omaha > > > http://www.OmahaPython.org > > > > > > > > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From shawnhermans at gmail.com Thu Jun 14 19:32:53 2012 From: shawnhermans at gmail.com (Shawn Hermans) Date: Thu, 14 Jun 2012 12:32:53 -0500 Subject: [omaha] Django question In-Reply-To: References: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> Message-ID: I am not sure, but serialization might help out in this instance. The error might be caused by file objects not being able to be pickled by Python. If you base64 encode the data, then this should be no problem, because it is just plain text. Again, just a guess. On Tue, Jun 12, 2012 at 4:58 PM, Steve Young wrote: > Thanks to everyone for the comments and suggestions!! > > Firstly, Mike > > > There may be a way around it (use Django for views and Anki db for > > database access) > > > This is what I am attempting. More of a proof of concept, with converting > to Django models later (maybe)... I am using Django auth for users and > permissions. > > Jeff and Shawn - > > > From the sounds of it you have a bunch of flash cards that are stored > in a > > single or multiple SQLite databases. You want to make these flash cards > > web accessible. What I am not clear on is whether you want users to be > > able to customize flash cards or you want them to be able to use > > pre-canned flash card sets. > > > So 1 SQLite database per deck, and the ability to create and edit decks. > Each user will have his own decks. I am thinking about trying the > FileField approach to associate the users with their decks. Encoding is > overkill at the moment, but I might try it, as it would be useful if I ever > deploy this publicly. > > BUT back to my original question about multi-user - the error I was getting > originally when trying to open 2 decks at once was a file in use error - I > was mistakenly trying to open the same deck/db file in each instance. So I > corrected this, and am able to open 2 different decks/files at the same > time. > > So in the load_deck view, I create a deck and render it in the template: > def load_deck(request): > from anki.deck import DeckStorage > deck = DeckStorage.Deck('media/test10.anki') > return render(request, 'flfanki/load_deck.html', { 'deck': deck }) > > I now need to be able to have a link in the rendered template that says > something like - I am finished studying - and pulls up the close_deck view > and closes the deck. But how do I pass the deck object into the view so > it knows which deck to close? I tried adding the deck to request object: > request.session['deckObject'] = deck > but get an error saying you can't pickle an instancemethod. > > Or if I implement the FileField approach, will that help with the issue? > > I am stuck once again... > > Steve > > > On Thu, Jun 7, 2012 at 7:52 PM, Shawn Hermans >wrote: > > > I am going to start off by saying I am probably guessing on what you are > > trying to do. From the sounds of it you have a bunch of flash cards that > > are stored in a single or multiple SQLite databases. You want to make > > these flash cards web accessible. What I am not clear on is whether you > > want users to be able to customize flash cards or you want them to be > able > > to use pre-canned flash card sets. > > > > All that being said, one idea is to store the flash cards on disk and > use a > > Django filefield to access the stored database. Below is a quick example > > of a Django model. I am going off memory and so I wouldn't trust this > > code. Plus the indentation probably is off too. > > > > class FlashCard(models.Model): > > sqlitedb = FileField() > > name = CharField() > > description = CharField() > > user = ForeignKey(User) > > > > Alternatively, you could store the SQLite database as a binary object > > within your database. Here is a recipe for creating a blob field using > > base64 encoding > > http://djangosnippets.org/snippets/1597/. > > > > I am not saying these are the most elegant solutions out there, but they > > have a chance of working. If that doesn't work, try duct tape. That > always > > seems to work for me. > > > > Cheers, > > Shawn > > > > I can only guess to the impacts to performance using this type of > approach. > > My guess is you would be okay as long as the SQLite databases are small > and > > change infrequently. If they are relatively static, you should be able > to > > use Django's cache framework to cache the files and not need to hit the > DB > > or the file system. > > > > > > > > On Thu, Jun 7, 2012 at 4:30 PM, Mike Hostetler > >wrote: > > > > > > > > You don't have a choice -- you have to use Django models to access the > > > database. There may be a way around it (use Django for views and Anki > db > > > for database access) but then you are using heavy-weight Django with a > > > by-pass. So you may have to deal with Django's problems and not reap > any > > > of it's benefits. > > > > > > Maybe try web.py or Flask. They are supposed to be lighter-weight. They > > > could handle the web portion and you could roll our own (or use Anki's) > > db > > > backend. > > > > > > > > > > > > Steve Young wrote: > > > > Hey Guys, > > > > > > > > I am trying to create a flashcard web app. There is a python open > > source > > > > flashcard program called Anki that the author has made available, and > > has > > > > also conveniently separated the backend code. I would like to use > it's > > > > library code if possible. It loads the flashcard decks, has spaced > > > > repetition, stats, and many other nice features. But it was created > > for a > > > > desktop app - not a web app with many users connecting at the same > time > > > > (although no deck will be accessed concurrently). > > > > > > > > I have been able to create a django project, load the anki code into > it > > > as > > > > app, and create a page loading a sample deck. I am not sure the best > > way > > > > to proceed in making this work for multi-users, or even if this is a > > good > > > > idea. Since I am not using django models (the anki code uses sqlite3 > > > > db's, > > > > one for each deck) I am not sure how to proceed (all the books and > > docs I > > > > have studied have been using django models). > > > > > > > > Any ideas, tips, links?? > > > > > > > > Thanks. > > > > > > > > Steve > > > > _______________________________________________ > > > > Omaha Python Users Group mailing list > > > > Omaha at python.org > > > > http://mail.python.org/mailman/listinfo/omaha > > > > http://www.OmahaPython.org > > > > > > > > > > > > > _______________________________________________ > > > Omaha Python Users Group mailing list > > > Omaha at python.org > > > http://mail.python.org/mailman/listinfo/omaha > > > http://www.OmahaPython.org > > > > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From shawnhermans at gmail.com Thu Jun 14 19:38:11 2012 From: shawnhermans at gmail.com (Shawn Hermans) Date: Thu, 14 Jun 2012 12:38:11 -0500 Subject: [omaha] Experience with django-social-auth or something similar? Message-ID: All, I am currently working on Google App Engine application that uses Django-nonrel. I am want to add the ability to have users sign in with existing accounts (e.g. Facebook, Google, Twitter, OpenID, etc...). I have done some research and there seems to be a few options out there. Out of all those options, django-social-auth seems to be the most robust and mature. However, before I pick any single solution to try out, I wanted to see if anyone had prior experience with doing this in Django. Has anyone tried using this or another federated login solution? Thanks, Shawn From jeffh at dundeemt.com Fri Jun 15 14:23:25 2012 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Fri, 15 Jun 2012 07:23:25 -0500 Subject: [omaha] Experience with django-social-auth or something similar? In-Reply-To: References: Message-ID: Shawn, Have you heard back from anyone on this? I am interested as well. I've read a number of stories about oauth/python but recall them talking about having to hack an existing lib or create their own. Best, Jeff On Thu, Jun 14, 2012 at 12:38 PM, Shawn Hermans wrote: > All, > I am currently working on Google App Engine application that uses > Django-nonrel. I am want to add the ability to have users sign in with > existing accounts (e.g. Facebook, Google, Twitter, OpenID, etc...). I have > done some research and there seems to be a few options out there. Out of > all those options, django-social-auth seems to be the most robust and > mature. > > However, before I pick any single solution to try out, I wanted to see if > anyone had prior experience with doing this in Django. Has anyone tried > using this or another federated login solution? > > Thanks, > Shawn > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Best, Jeff Hinrichs 402.218.1473 From jeffh at dundeemt.com Fri Jun 15 14:46:32 2012 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Fri, 15 Jun 2012 07:46:32 -0500 Subject: [omaha] Django question In-Reply-To: References: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> Message-ID: At the end of the request: def load_deck(request): from anki.deck import DeckStorage deck = DeckStorage.Deck('media/test10.anki') #at the end of the request cycle I go out of scope return render(request, 'flfanki/load_deck.html', { 'deck': deck }) deck goes out of scope and goes away. There would be nothing to close. Web interactions are state-less, think of the scenario where I pull up a deck in your weblication on a windows pc, and IE causes the machine to reboot. Even if "deck" didn't go away at the end of the request, how would you know when to close it manually? If you want to track state, it is up to you. You have to send stuff to the client that it sends back with each request. (a.k.a cookies) Django sessions https://docs.djangoproject.com/en/dev/topics/http/sessions/ are how you take care of state tracking. You might want to look at making deck a session variable. Best, Jeff On Thu, Jun 14, 2012 at 12:32 PM, Shawn Hermans wrote: > I am not sure, but serialization might help out in this instance. The > error might be caused by file objects not being able to be pickled by > Python. If you base64 encode the data, then this should be no problem, > because it is just plain text. Again, just a guess. > > On Tue, Jun 12, 2012 at 4:58 PM, Steve Young >wrote: > > > Thanks to everyone for the comments and suggestions!! > > > > Firstly, Mike > > > > > There may be a way around it (use Django for views and Anki db for > > > database access) > > > > > > This is what I am attempting. More of a proof of concept, with > converting > > to Django models later (maybe)... I am using Django auth for users and > > permissions. > > > > Jeff and Shawn - > > > > > From the sounds of it you have a bunch of flash cards that are stored > > in a > > > single or multiple SQLite databases. You want to make these flash > cards > > > web accessible. What I am not clear on is whether you want users to be > > > able to customize flash cards or you want them to be able to use > > > pre-canned flash card sets. > > > > > > So 1 SQLite database per deck, and the ability to create and edit decks. > > Each user will have his own decks. I am thinking about trying the > > FileField approach to associate the users with their decks. Encoding is > > overkill at the moment, but I might try it, as it would be useful if I > ever > > deploy this publicly. > > > > BUT back to my original question about multi-user - the error I was > getting > > originally when trying to open 2 decks at once was a file in use error - > I > > was mistakenly trying to open the same deck/db file in each instance. > So I > > corrected this, and am able to open 2 different decks/files at the same > > time. > > > > So in the load_deck view, I create a deck and render it in the template: > > def load_deck(request): > > from anki.deck import DeckStorage > > deck = DeckStorage.Deck('media/test10.anki') > > return render(request, 'flfanki/load_deck.html', { 'deck': deck }) > > > > I now need to be able to have a link in the rendered template that says > > something like - I am finished studying - and pulls up the close_deck > view > > and closes the deck. But how do I pass the deck object into the view so > > it knows which deck to close? I tried adding the deck to request object: > > request.session['deckObject'] = deck > > but get an error saying you can't pickle an instancemethod. > > > > Or if I implement the FileField approach, will that help with the issue? > > > > I am stuck once again... > > > > Steve > > > > > > On Thu, Jun 7, 2012 at 7:52 PM, Shawn Hermans > >wrote: > > > > > I am going to start off by saying I am probably guessing on what you > are > > > trying to do. From the sounds of it you have a bunch of flash cards > that > > > are stored in a single or multiple SQLite databases. You want to make > > > these flash cards web accessible. What I am not clear on is whether > you > > > want users to be able to customize flash cards or you want them to be > > able > > > to use pre-canned flash card sets. > > > > > > All that being said, one idea is to store the flash cards on disk and > > use a > > > Django filefield to access the stored database. Below is a quick > example > > > of a Django model. I am going off memory and so I wouldn't trust this > > > code. Plus the indentation probably is off too. > > > > > > class FlashCard(models.Model): > > > sqlitedb = FileField() > > > name = CharField() > > > description = CharField() > > > user = ForeignKey(User) > > > > > > Alternatively, you could store the SQLite database as a binary object > > > within your database. Here is a recipe for creating a blob field using > > > base64 encoding > > > http://djangosnippets.org/snippets/1597/. > > > > > > I am not saying these are the most elegant solutions out there, but > they > > > have a chance of working. If that doesn't work, try duct tape. That > > always > > > seems to work for me. > > > > > > Cheers, > > > Shawn > > > > > > I can only guess to the impacts to performance using this type of > > approach. > > > My guess is you would be okay as long as the SQLite databases are small > > and > > > change infrequently. If they are relatively static, you should be able > > to > > > use Django's cache framework to cache the files and not need to hit the > > DB > > > or the file system. > > > > > > > > > > > > On Thu, Jun 7, 2012 at 4:30 PM, Mike Hostetler > > >wrote: > > > > > > > > > > > You don't have a choice -- you have to use Django models to access > the > > > > database. There may be a way around it (use Django for views and > Anki > > db > > > > for database access) but then you are using heavy-weight Django with > a > > > > by-pass. So you may have to deal with Django's problems and not reap > > any > > > > of it's benefits. > > > > > > > > Maybe try web.py or Flask. They are supposed to be lighter-weight. > They > > > > could handle the web portion and you could roll our own (or use > Anki's) > > > db > > > > backend. > > > > > > > > > > > > > > > > Steve Young wrote: > > > > > Hey Guys, > > > > > > > > > > I am trying to create a flashcard web app. There is a python open > > > source > > > > > flashcard program called Anki that the author has made available, > and > > > has > > > > > also conveniently separated the backend code. I would like to use > > it's > > > > > library code if possible. It loads the flashcard decks, has spaced > > > > > repetition, stats, and many other nice features. But it was created > > > for a > > > > > desktop app - not a web app with many users connecting at the same > > time > > > > > (although no deck will be accessed concurrently). > > > > > > > > > > I have been able to create a django project, load the anki code > into > > it > > > > as > > > > > app, and create a page loading a sample deck. I am not sure the > best > > > way > > > > > to proceed in making this work for multi-users, or even if this is > a > > > good > > > > > idea. Since I am not using django models (the anki code uses > sqlite3 > > > > > db's, > > > > > one for each deck) I am not sure how to proceed (all the books and > > > docs I > > > > > have studied have been using django models). > > > > > > > > > > Any ideas, tips, links?? > > > > > > > > > > Thanks. > > > > > > > > > > Steve > > > > > _______________________________________________ > > > > > Omaha Python Users Group mailing list > > > > > Omaha at python.org > > > > > http://mail.python.org/mailman/listinfo/omaha > > > > > http://www.OmahaPython.org > > > > > > > > > > > > > > > > > _______________________________________________ > > > > Omaha Python Users Group mailing list > > > > Omaha at python.org > > > > http://mail.python.org/mailman/listinfo/omaha > > > > http://www.OmahaPython.org > > > > > > > _______________________________________________ > > > Omaha Python Users Group mailing list > > > Omaha at python.org > > > http://mail.python.org/mailman/listinfo/omaha > > > http://www.OmahaPython.org > > > > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Best, Jeff Hinrichs 402.218.1473 From shawnhermans at gmail.com Fri Jun 15 15:57:11 2012 From: shawnhermans at gmail.com (Shawn Hermans) Date: Fri, 15 Jun 2012 08:57:11 -0500 Subject: [omaha] Experience with django-social-auth or something similar? In-Reply-To: References: Message-ID: Jeff, I will let you know. I had an initial success with something called Django-facebook, but django-social-auth seemed more active and robust. This was also my first time using App Engine, so I have a little bit of a learning curve. Hopefully, I will get time this weekend to finish things up. Thanks, Shawn On Fri, Jun 15, 2012 at 7:23 AM, Jeff Hinrichs - DM&T wrote: > Shawn, > > Have you heard back from anyone on this? I am interested as well. I've > read a number of stories about oauth/python but recall them talking about > having to hack an existing lib or create their own. > > Best, > > Jeff > > On Thu, Jun 14, 2012 at 12:38 PM, Shawn Hermans >wrote: > > > All, > > I am currently working on Google App Engine application that uses > > Django-nonrel. I am want to add the ability to have users sign in with > > existing accounts (e.g. Facebook, Google, Twitter, OpenID, etc...). I > have > > done some research and there seems to be a few options out there. Out of > > all those options, django-social-auth seems to be the most robust and > > mature. > > > > However, before I pick any single solution to try out, I wanted to see if > > anyone had prior experience with doing this in Django. Has anyone tried > > using this or another federated login solution? > > > > Thanks, > > Shawn > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > > > > -- > Best, > > Jeff Hinrichs > 402.218.1473 > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From wereapwhatwesow at gmail.com Fri Jun 15 18:13:03 2012 From: wereapwhatwesow at gmail.com (Steve Young) Date: Fri, 15 Jun 2012 11:13:03 -0500 Subject: [omaha] Django question In-Reply-To: References: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> Message-ID: > > ... You might want to look at making deck a session variable. So now I am trying to accomplish just that. deck seems to be an instancemethod because when I try to add it to the request.session it gives a: Can't pickle : attribute lookup __builtin__.instancemethod failed I found some suggestions about adding __getstate__ and __setstate__ to the class to make the instancemethod pickable, but haven't been successful with those either. (not 100% sure I am implementing this correctly) The only progress I made was using a shell to get a little different pickle error: PicklingError: Can't pickle : it's not the same object as sqlalchemy.orm.session.Session I also tried Shawn's suggestion about encoding deck, with base64.encode and base64.encodestring but got TypeErrors with both. Since this is becoming so difficult, and I don't see much info online when searching for these issues, it makes me think I am not taking the correct approach. Or maybe I should work some more on the pickling issue... Any ideas are welcome. Thanks for everyone's help so far. Steve From shawnhermans at gmail.com Fri Jun 15 18:41:49 2012 From: shawnhermans at gmail.com (Shawn Hermans) Date: Fri, 15 Jun 2012 11:41:49 -0500 Subject: [omaha] Django question In-Reply-To: References: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> Message-ID: I can't think of any other easy solutions to the problem. I looked at the libanki code and it looks like the database code is spread throughout the library. I also uses raw SQL rather than something like SQLAlchemy or the Django ORM. This means it is not trivial to simply use a different database in place of SQLite. So, I can't really think of an easy solution to the problem. Now I can think of a not easy solution. You could fork the libanki code base and port it over to use SQLAlchemy or Django's ORM. I pulled out the tables from the source code and it doesn't look too bad. It looks like you have 5 tables/models. Something to think about at least. Cheers, Shawn create table if not exists col ( id integer primary key, crt integer not null, mod integer not null, scm integer not null, ver integer not null, dty integer not null, usn integer not null, ls integer not null, conf text not null, models text not null, decks text not null, dconf text not null, tags text not null ); create table if not exists notes ( id integer primary key, guid text not null, mid integer not null, mod integer not null, usn integer not null, tags text not null, flds text not null, sfld integer not null, csum integer not null, flags integer not null, data text not null ); create table if not exists cards ( id integer primary key, nid integer not null, did integer not null, ord integer not null, mod integer not null, usn integer not null, type integer not null, queue integer not null, due integer not null, ivl integer not null, factor integer not null, reps integer not null, lapses integer not null, left integer not null, odue integer not null, odid integer not null, flags integer not null, data text not null ); create table if not exists revlog ( id integer primary key, cid integer not null, usn integer not null, ease integer not null, ivl integer not null, lastIvl integer not null, factor integer not null, time integer not null, type integer not null ); create table if not exists graves ( usn integer not null, oid integer not null, type integer not null ); On Fri, Jun 15, 2012 at 11:13 AM, Steve Young wrote: > > > > ... You might want to look at making deck a session variable. > > > So now I am trying to accomplish just that. deck seems to be an > instancemethod because when I try to add it to the request.session it gives > a: > > Can't pickle : attribute lookup > __builtin__.instancemethod failed > > I found some suggestions about adding __getstate__ and __setstate__ to the > class to make the instancemethod pickable, but haven't been successful > with those either. (not 100% sure I am implementing this correctly) The > only progress I made was using a shell to get a little different pickle > error: > > PicklingError: Can't pickle : it's > not the same object as sqlalchemy.orm.session.Session > > I also tried Shawn's suggestion about encoding deck, with base64.encode and > base64.encodestring but got TypeErrors with both. > > Since this is becoming so difficult, and I don't see much info online when > searching for these issues, it makes me think I am not taking the correct > approach. Or maybe I should work some more on the pickling issue... Any > ideas are welcome. Thanks for everyone's help so far. > > Steve > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From jeffh at dundeemt.com Fri Jun 15 21:09:05 2012 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Fri, 15 Jun 2012 14:09:05 -0500 Subject: [omaha] Django question In-Reply-To: References: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> Message-ID: Although not a walk in the park, I am with Shawn. There are other gotcha's you are going to run into if you continue down the "a pickled sqlite db for everyone" road. Best, Jeff On Fri, Jun 15, 2012 at 11:41 AM, Shawn Hermans wrote: > I can't think of any other easy solutions to the problem. I looked at the > libanki code and it looks like the database code is spread throughout the > library. I also uses raw SQL rather than something like SQLAlchemy or the > Django ORM. This means it is not trivial to simply use a different database > in place of SQLite. So, I can't really think of an easy solution to the > problem. > > Now I can think of a not easy solution. You could fork the libanki code > base and port it over to use SQLAlchemy or Django's ORM. I pulled out the > tables from the source code and it doesn't look too bad. It looks like you > have 5 tables/models. Something to think about at least. > > Cheers, > Shawn > > create table if not exists col ( > id integer primary key, > crt integer not null, > mod integer not null, > scm integer not null, > ver integer not null, > dty integer not null, > usn integer not null, > ls integer not null, > conf text not null, > models text not null, > decks text not null, > dconf text not null, > tags text not null > ); > > create table if not exists notes ( > id integer primary key, > guid text not null, > mid integer not null, > mod integer not null, > usn integer not null, > tags text not null, > flds text not null, > sfld integer not null, > csum integer not null, > flags integer not null, > data text not null > ); > > create table if not exists cards ( > id integer primary key, > nid integer not null, > did integer not null, > ord integer not null, > mod integer not null, > usn integer not null, > type integer not null, > queue integer not null, > due integer not null, > ivl integer not null, > factor integer not null, > reps integer not null, > lapses integer not null, > left integer not null, > odue integer not null, > odid integer not null, > flags integer not null, > data text not null > ); > > create table if not exists revlog ( > id integer primary key, > cid integer not null, > usn integer not null, > ease integer not null, > ivl integer not null, > lastIvl integer not null, > factor integer not null, > time integer not null, > type integer not null > ); > > create table if not exists graves ( > usn integer not null, > oid integer not null, > type integer not null > ); > > > > On Fri, Jun 15, 2012 at 11:13 AM, Steve Young >wrote: > > > > > > > ... You might want to look at making deck a session variable. > > > > > > So now I am trying to accomplish just that. deck seems to be an > > instancemethod because when I try to add it to the request.session it > gives > > a: > > > > Can't pickle : attribute lookup > > __builtin__.instancemethod failed > > > > I found some suggestions about adding __getstate__ and __setstate__ to > the > > class to make the instancemethod pickable, but haven't been successful > > with those either. (not 100% sure I am implementing this correctly) The > > only progress I made was using a shell to get a little different pickle > > error: > > > > PicklingError: Can't pickle : > it's > > not the same object as sqlalchemy.orm.session.Session > > > > I also tried Shawn's suggestion about encoding deck, with base64.encode > and > > base64.encodestring but got TypeErrors with both. > > > > Since this is becoming so difficult, and I don't see much info online > when > > searching for these issues, it makes me think I am not taking the correct > > approach. Or maybe I should work some more on the pickling issue... Any > > ideas are welcome. Thanks for everyone's help so far. > > > > Steve > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Best, Jeff Hinrichs 402.218.1473 From mike at hostetlerhome.com Fri Jun 15 22:10:36 2012 From: mike at hostetlerhome.com (Mike Hostetler) Date: Fri, 15 Jun 2012 15:10:36 -0500 Subject: [omaha] Django question In-Reply-To: References: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> Message-ID: If it we me, I would probably use the SQLite database to generate my Django objects and then just go from there. Their design sounds . . . .horrid. There is a document on how to do this: https://docs.djangoproject.com/en/dev/howto/legacy-databases/?from=olddocs Jeff Hinrichs - DM&T wrote: > Although not a walk in the park, I am with Shawn. There are other > gotcha's > you are going to run into if you continue down the "a pickled sqlite db > for > everyone" road. > > Best, > > Jeff > > On Fri, Jun 15, 2012 at 11:41 AM, Shawn Hermans > wrote: > >> I can't think of any other easy solutions to the problem. I looked at >> the >> libanki code and it looks like the database code is spread throughout >> the >> library. I also uses raw SQL rather than something like SQLAlchemy or >> the >> Django ORM. This means it is not trivial to simply use a different >> database >> in place of SQLite. So, I can't really think of an easy solution to the >> problem. >> >> Now I can think of a not easy solution. You could fork the libanki code >> base and port it over to use SQLAlchemy or Django's ORM. I pulled out >> the >> tables from the source code and it doesn't look too bad. It looks like >> you >> have 5 tables/models. Something to think about at least. >> >> Cheers, >> Shawn >> >> create table if not exists col ( >> id integer primary key, >> crt integer not null, >> mod integer not null, >> scm integer not null, >> ver integer not null, >> dty integer not null, >> usn integer not null, >> ls integer not null, >> conf text not null, >> models text not null, >> decks text not null, >> dconf text not null, >> tags text not null >> ); >> >> create table if not exists notes ( >> id integer primary key, >> guid text not null, >> mid integer not null, >> mod integer not null, >> usn integer not null, >> tags text not null, >> flds text not null, >> sfld integer not null, >> csum integer not null, >> flags integer not null, >> data text not null >> ); >> >> create table if not exists cards ( >> id integer primary key, >> nid integer not null, >> did integer not null, >> ord integer not null, >> mod integer not null, >> usn integer not null, >> type integer not null, >> queue integer not null, >> due integer not null, >> ivl integer not null, >> factor integer not null, >> reps integer not null, >> lapses integer not null, >> left integer not null, >> odue integer not null, >> odid integer not null, >> flags integer not null, >> data text not null >> ); >> >> create table if not exists revlog ( >> id integer primary key, >> cid integer not null, >> usn integer not null, >> ease integer not null, >> ivl integer not null, >> lastIvl integer not null, >> factor integer not null, >> time integer not null, >> type integer not null >> ); >> >> create table if not exists graves ( >> usn integer not null, >> oid integer not null, >> type integer not null >> ); >> >> >> >> On Fri, Jun 15, 2012 at 11:13 AM, Steve Young > >wrote: >> >> > > >> > > ... You might want to look at making deck a session variable. >> > >> > >> > So now I am trying to accomplish just that. deck seems to be an >> > instancemethod because when I try to add it to the request.session it >> gives >> > a: >> > >> > Can't pickle : attribute lookup >> > __builtin__.instancemethod failed >> > >> > I found some suggestions about adding __getstate__ and __setstate__ to >> the >> > class to make the instancemethod pickable, but haven't been >> successful >> > with those either. (not 100% sure I am implementing this correctly) >> The >> > only progress I made was using a shell to get a little different >> pickle >> > error: >> > >> > PicklingError: Can't pickle : >> it's >> > not the same object as sqlalchemy.orm.session.Session >> > >> > I also tried Shawn's suggestion about encoding deck, with >> base64.encode >> and >> > base64.encodestring but got TypeErrors with both. >> > >> > Since this is becoming so difficult, and I don't see much info online >> when >> > searching for these issues, it makes me think I am not taking the >> correct >> > approach. Or maybe I should work some more on the pickling issue... >> Any >> > ideas are welcome. Thanks for everyone's help so far. >> > >> > Steve >> > _______________________________________________ >> > Omaha Python Users Group mailing list >> > Omaha at python.org >> > http://mail.python.org/mailman/listinfo/omaha >> > http://www.OmahaPython.org >> > >> _______________________________________________ >> Omaha Python Users Group mailing list >> Omaha at python.org >> http://mail.python.org/mailman/listinfo/omaha >> http://www.OmahaPython.org >> > > > > -- > Best, > > Jeff Hinrichs > 402.218.1473 > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From wereapwhatwesow at gmail.com Sun Jun 17 23:49:16 2012 From: wereapwhatwesow at gmail.com (Steve Young) Date: Sun, 17 Jun 2012 16:49:16 -0500 Subject: [omaha] Django question In-Reply-To: References: <7c6cf5a2742d94ada7d230ae327990c9.squirrel@email.powweb.com> Message-ID: I have been weighing 2 options - trying to use the anki code versus starting my own web app from scratch. The anki desktop program is full featured and has a large user base, but the online anki app leaves a lot to be desired. I had hoped to be able to enhance the anki program by 'upgrading' the online version, using as much of the libanki as possible and something like Django to serve it up. Since the general consensus is this will be more difficult than re-writing libanki as a normal django app, I guess I will start down that road. By the way, I am using anki v1.2.8 which has a few more tables than the 5 you all have been showing -here is a diagram: https://www.dropbox.com/s/wjcjsdikmy0bokn/anki%20database%20schem.gif So far I have been developing with django 1.3, python 2.7. Any reason to go to django 1.4? Thanks again for everyone's input. btw, monthly meeting is this Wednesday. Steve On Fri, Jun 15, 2012 at 3:10 PM, Mike Hostetler wrote: > > If it we me, I would probably use the SQLite database to generate my > Django objects and then just go from there. Their design sounds . . . > .horrid. > > There is a document on how to do this: > https://docs.djangoproject.com/en/dev/howto/legacy-databases/?from=olddocs > > > > Jeff Hinrichs - DM&T wrote: > > Although not a walk in the park, I am with Shawn. There are other > > gotcha's > > you are going to run into if you continue down the "a pickled sqlite db > > for > > everyone" road. > > > > Best, > > > > Jeff > > > > On Fri, Jun 15, 2012 at 11:41 AM, Shawn Hermans > > wrote: > > > >> I can't think of any other easy solutions to the problem. I looked at > > >> the > >> libanki code and it looks like the database code is spread throughout > >> the > >> library. I also uses raw SQL rather than something like SQLAlchemy or > >> the > >> Django ORM. This means it is not trivial to simply use a different > >> database > >> in place of SQLite. So, I can't really think of an easy solution to the > >> problem. > >> > >> Now I can think of a not easy solution. You could fork the libanki code > >> base and port it over to use SQLAlchemy or Django's ORM. I pulled out > >> the > >> tables from the source code and it doesn't look too bad. It looks like > >> you > >> have 5 tables/models. Something to think about at least. > >> > >> Cheers, > >> Shawn > >> > >> create table if not exists col ( > >> id integer primary key, > >> crt integer not null, > >> mod integer not null, > >> scm integer not null, > >> ver integer not null, > >> dty integer not null, > >> usn integer not null, > >> ls integer not null, > >> conf text not null, > >> models text not null, > >> decks text not null, > >> dconf text not null, > >> tags text not null > >> ); > >> > >> create table if not exists notes ( > >> id integer primary key, > >> guid text not null, > >> mid integer not null, > >> mod integer not null, > >> usn integer not null, > >> tags text not null, > >> flds text not null, > >> sfld integer not null, > >> csum integer not null, > >> flags integer not null, > >> data text not null > >> ); > >> > >> create table if not exists cards ( > >> id integer primary key, > >> nid integer not null, > >> did integer not null, > >> ord integer not null, > >> mod integer not null, > >> usn integer not null, > >> type integer not null, > >> queue integer not null, > >> due integer not null, > >> ivl integer not null, > >> factor integer not null, > >> reps integer not null, > >> lapses integer not null, > >> left integer not null, > >> odue integer not null, > >> odid integer not null, > >> flags integer not null, > >> data text not null > >> ); > >> > >> create table if not exists revlog ( > >> id integer primary key, > >> cid integer not null, > >> usn integer not null, > >> ease integer not null, > >> ivl integer not null, > >> lastIvl integer not null, > >> factor integer not null, > >> time integer not null, > >> type integer not null > >> ); > >> > >> create table if not exists graves ( > >> usn integer not null, > >> oid integer not null, > >> type integer not null > >> ); > >> > >> > >> > >> On Fri, Jun 15, 2012 at 11:13 AM, Steve Young < > wereapwhatwesow at gmail.com > >> >wrote: > >> > >> > > > >> > > ... You might want to look at making deck a session variable. > >> > > >> > > >> > So now I am trying to accomplish just that. deck seems to be an > >> > instancemethod because when I try to add it to the request.session it > >> gives > >> > a: > >> > > >> > Can't pickle : attribute lookup > >> > __builtin__.instancemethod failed > >> > > >> > I found some suggestions about adding __getstate__ and __setstate__ to > >> the > >> > class to make the instancemethod pickable, but haven't been > >> successful > >> > with those either. (not 100% sure I am implementing this correctly) > >> The > >> > only progress I made was using a shell to get a little different > >> pickle > >> > error: > >> > > >> > PicklingError: Can't pickle : > >> it's > >> > not the same object as sqlalchemy.orm.session.Session > >> > > >> > I also tried Shawn's suggestion about encoding deck, with > >> base64.encode > >> and > >> > base64.encodestring but got TypeErrors with both. > >> > > >> > Since this is becoming so difficult, and I don't see much info online > >> when > >> > searching for these issues, it makes me think I am not taking the > >> correct > >> > approach. Or maybe I should work some more on the pickling issue... > >> Any > >> > ideas are welcome. Thanks for everyone's help so far. > >> > > >> > Steve > >> > _______________________________________________ > >> > Omaha Python Users Group mailing list > >> > Omaha at python.org > >> > http://mail.python.org/mailman/listinfo/omaha > >> > http://www.OmahaPython.org > >> > > >> _______________________________________________ > >> Omaha Python Users Group mailing list > >> Omaha at python.org > >> http://mail.python.org/mailman/listinfo/omaha > >> http://www.OmahaPython.org > >> > > > > > > > > -- > > Best, > > > > Jeff Hinrichs > > 402.218.1473 > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From wereapwhatwesow at gmail.com Mon Jun 18 16:58:01 2012 From: wereapwhatwesow at gmail.com (Steve Young) Date: Mon, 18 Jun 2012 09:58:01 -0500 Subject: [omaha] June Meeting Message-ID: I hope everyone is having a good summer so far. This month's meeting is Wednesday evening, 7pm. My office is available (ALR 13829 Industrial Road) or we can meet elsewhere depending on who is coming - the summer meetings can be a little slim in attendance. Let me know if you are coming. I did get a DVI to VGA adapter but was not able to make it work with the TV... Steve From jeffh at dundeemt.com Tue Jun 19 17:46:08 2012 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Tue, 19 Jun 2012 10:46:08 -0500 Subject: [omaha] June Meeting In-Reply-To: References: Message-ID: So, are we on at your Office? Sounds good to me! On Mon, Jun 18, 2012 at 9:58 AM, Steve Young wrote: > I hope everyone is having a good summer so far. This month's meeting is > Wednesday evening, 7pm. > > My office is available (ALR 13829 Industrial Road) or we can meet elsewhere > depending on who is coming - the summer meetings can be a little slim in > attendance. Let me know if you are coming. > > I did get a DVI to VGA adapter but was not able to make it work with the > TV... > > Steve > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Best, Jeff Hinrichs 402.218.1473 From newz at bearfruit.org Tue Jun 19 21:51:31 2012 From: newz at bearfruit.org (Matthew Nuzum) Date: Tue, 19 Jun 2012 14:51:31 -0500 Subject: [omaha] Web developer training this summer Message-ID: Hey everyone, I'm a local (Des Moines) web dev and I love to share what I know. I've been doing one-on-one developer training for a few years now and have decided to take it to the next level. I'm starting an online class July 9th to teach web development, focusing on HTML, CSS, JS and MVC-style development with Django. (We'll be using Python and Django but focusing on the essentials of MVC so that the skills can apply to multiple frameworks) Classes are in the evenings, meeting Monday and Thursday 7:00 - 9:00 with times throughout the week for one-on-one time. Everyone will have a mentor available that they can work with via Skype to help them when they get stuck. This is an intensive class and in the 7.5 weeks that it runs we'll cover a lot of ground. The emphasis will be on breaking through the barriers that make it hard to get started, learning tools that help you be productive quickly and learning what to do when you get stuck. I've posted a website for the class at www.OtherLearners.com but feel free to email me if you have any questions. Also, if you mention the Omaha Python Users group I'll discount the cost by $150. -- Matthew Nuzum newz2000 on freenode, skype, linkedin and twitter ? You're never fully dressed without a smile! ? From jrguliz at yahoo.com Wed Jun 20 07:31:21 2012 From: jrguliz at yahoo.com (Joe Gulizia) Date: Tue, 19 Jun 2012 22:31:21 -0700 (PDT) Subject: [omaha] June Meeting In-Reply-To: References: Message-ID: <1340170281.41444.YahooMailNeo@web112802.mail.gq1.yahoo.com> Plannbeing there. Joe ________________________________ From: Jeff Hinrichs - DM&T To: Omaha Python Users Group Sent: Tuesday, June 19, 2012 10:46 AM Subject: Re: [omaha] June Meeting So, are we on at your Office?? Sounds good to me! On Mon, Jun 18, 2012 at 9:58 AM, Steve Young wrote: > I hope everyone is having a good summer so far.? This month's meeting is > Wednesday evening, 7pm. > > My office is available (ALR 13829 Industrial Road) or we can meet elsewhere > depending on who is coming - the summer meetings can be a little slim in > attendance.? Let me know if you are coming. > > I did get a DVI to VGA adapter but was not able to make it work with the > TV... > > Steve > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Best, Jeff Hinrichs 402.218.1473 _______________________________________________ Omaha Python Users Group mailing list Omaha at python.org http://mail.python.org/mailman/listinfo/omaha http://www.OmahaPython.org From jrguliz at yahoo.com Thu Jun 21 00:56:15 2012 From: jrguliz at yahoo.com (Joe Gulizia) Date: Wed, 20 Jun 2012 15:56:15 -0700 (PDT) Subject: [omaha] June Meeting In-Reply-To: References: Message-ID: <1340232975.24369.YahooMailNeo@web112816.mail.gq1.yahoo.com> Was hoping to make it but no dice. Joe ________________________________ From: Jeff Hinrichs - DM&T To: Omaha Python Users Group Sent: Tuesday, June 19, 2012 10:46 AM Subject: Re: [omaha] June Meeting So, are we on at your Office?? Sounds good to me! On Mon, Jun 18, 2012 at 9:58 AM, Steve Young wrote: > I hope everyone is having a good summer so far.? This month's meeting is > Wednesday evening, 7pm. > > My office is available (ALR 13829 Industrial Road) or we can meet elsewhere > depending on who is coming - the summer meetings can be a little slim in > attendance.? Let me know if you are coming. > > I did get a DVI to VGA adapter but was not able to make it work with the > TV... > > Steve > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Best, Jeff Hinrichs 402.218.1473 _______________________________________________ Omaha Python Users Group mailing list Omaha at python.org http://mail.python.org/mailman/listinfo/omaha http://www.OmahaPython.org From jrguliz at yahoo.com Thu Jun 21 00:56:32 2012 From: jrguliz at yahoo.com (Joe Gulizia) Date: Wed, 20 Jun 2012 15:56:32 -0700 (PDT) Subject: [omaha] June Meeting In-Reply-To: References: Message-ID: <1340232992.14657.YahooMailNeo@web112816.mail.gq1.yahoo.com> Was o make it but no dice. Joe ________________________________ From: Jeff Hinrichs - DM&T To: Omaha Python Users Group Sent: Tuesday, June 19, 2012 10:46 AM Subject: Re: [omaha] June Meeting So, are we on at your Office?? Sounds good to me! On Mon, Jun 18, 2012 at 9:58 AM, Steve Young wrote: > I hope everyone is having a good summer so far.? This month's meeting is > Wednesday evening, 7pm. > > My office is available (ALR 13829 Industrial Road) or we can meet elsewhere > depending on who is coming - the summer meetings can be a little slim in > attendance.? Let me know if you are coming. > > I did get a DVI to VGA adapter but was not able to make it work with the > TV... > > Steve > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Best, Jeff Hinrichs 402.218.1473 _______________________________________________ Omaha Python Users Group mailing list Omaha at python.org http://mail.python.org/mailman/listinfo/omaha http://www.OmahaPython.org From jeffh at dundeemt.com Thu Jun 21 00:58:07 2012 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Wed, 20 Jun 2012 17:58:07 -0500 Subject: [omaha] June Meeting In-Reply-To: <1340232975.24369.YahooMailNeo@web112816.mail.gq1.yahoo.com> References: <1340232975.24369.YahooMailNeo@web112816.mail.gq1.yahoo.com> Message-ID: I'm still coming and looking forward to the best meeting ever! -Jeff On Wed, Jun 20, 2012 at 5:56 PM, Joe Gulizia wrote: > Was hoping to make it but no dice. > > Joe > > > ________________________________ > From: Jeff Hinrichs - DM&T > To: Omaha Python Users Group > Sent: Tuesday, June 19, 2012 10:46 AM > Subject: Re: [omaha] June Meeting > > So, are we on at your Office? Sounds good to me! > > > On Mon, Jun 18, 2012 at 9:58 AM, Steve Young >wrote: > > > I hope everyone is having a good summer so far. This month's meeting is > > Wednesday evening, 7pm. > > > > My office is available (ALR 13829 Industrial Road) or we can meet > elsewhere > > depending on who is coming - the summer meetings can be a little slim in > > attendance. Let me know if you are coming. > > > > I did get a DVI to VGA adapter but was not able to make it work with the > > TV... > > > > Steve > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > > > > -- > Best, > > Jeff Hinrichs > 402.218.1473 > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Best, Jeff Hinrichs 402.218.1473 From jrguliz at yahoo.com Thu Jun 21 01:16:00 2012 From: jrguliz at yahoo.com (Joe Gulizia) Date: Wed, 20 Jun 2012 16:16:00 -0700 (PDT) Subject: [omaha] June Meeting Message-ID: <1340234160.47531.YahooMailMobile@web112808.mail.gq1.yahoo.com> Missed seeing u @ CERT. I may email in. What topics?