From wereapwhatwesow at gmail.com Fri Aug 1 19:05:24 2014 From: wereapwhatwesow at gmail.com (Steve Young) Date: Fri, 1 Aug 2014 12:05:24 -0500 Subject: [omaha] How to retrieve distinct model rows Message-ID: Hello everyone. I have some working code for this, but it looks terrible, and hope someone can help me clean it up. I have a django model like: *class Topic(models.Model):* * name = models.TextField(default='')* * language = models.CharField(max_length=7, choices=LANGUAGES, default='en')* So the *language* field is something like 'en' or 'es' or 'de', from django.conf.global_settings LANGUAGES... I am retrieving a list of the topic.languages, without duplicates, to display onto a page as links. The links take you to another page with a list of the topics with that specific language. Here is my current view with some comments: *def home_page(request):* * topic_language_codes = Topic.objects.values_list('language', flat=True)* #get list of languages with possible duplicates * topic_language_codes = list(set(topic_language_codes))* #eliminate dupes * topic_languages = []* * def find_languages(list_, codes):* #I need both the code and full name available in the template * for code, language in list_:* * if code == codes:* * yield code, language* * for code in topic_language_codes:* * topic_languages += list(find_languages(LANGUAGES, code))* * topic_languages.sort(key=operator.itemgetter(1))* #need to be sorted by name, not code * return render(request, 'home.html', {'languages': topic_languages})* I know I can move some of this code to a model manager, and possibly take advantage of the availability of LANGUAGES in the template context, but I am wondering if it would be better to create a model for Languages and make Topic.language a FK? Or something else? Another piece of django magic that if I understood may help me with this - on the django admin page for creating a Topic, the choice field automagically shows the language name (not the 2 digit code). How does django know to do this? Thanks. Steve From wereapwhatwesow at gmail.com Mon Aug 11 03:00:36 2014 From: wereapwhatwesow at gmail.com (Steve Young) Date: Sun, 10 Aug 2014 20:00:36 -0500 Subject: [omaha] Best bootstrap introduction - with images! Message-ID: I know this isn't Python, but if you are using or thinking of using Bootstrap 3 for some web design, this will help: http://www.helloerik.com/the-subtle-magic-behind-why-the-bootstrap-3-grid-works Steve From brian at python.org Thu Aug 14 04:58:10 2014 From: brian at python.org (Brian Curtin) Date: Thu, 14 Aug 2014 02:58:10 -0000 Subject: [omaha] PyCon 2015 Call for Proposals is open! Message-ID: Hi Omaha Python Users Group! The PyCon organizers invite you to submit proposals for talks, tutorials, and posters to be presented at PyCon 2015 - https://us.pycon.org/2015/. The conference takes place April 8-16 in Montreal, Queubec, Canada and we'll be accepting talk and tutorial proposals through September 15, with posters accepted through November 1! We want everyone to be a part of making PyCon what it is, which is why we invite everyone to submit proposals, and we invite everyone to be a part of the program committee. It's your PyCon, not mine. Whether you started with Python yesterday or you've been writing it since the 90s, everyone has different experiences, different knowledge, and a different story to tell. This is why we aim to strike a balance between beginner, intermediate, and advanced talks. We want the entire community to level up as a result of PyCon. Over the years, we've put together proposal resources and advice to help answer some common topics surrounding our CFP (https://us.pycon.org/2015/speaking/proposal-resources/). We even put together a sample proposal and reviewed it for you at https://us.pycon.org/2015/speaking/proposal_advice/samples/SpacePug/. If you have any questions or tips that may help others, please email them to pycon-pc at python.org, or feel free to respond and I'll help you out. The full details of our Call for Proposals are available at https://us.pycon.org/2015/speaking/cfp/. Keep an eye on that page as well as https://twitter.com/pycon and http://pycon.blogspot.com/ for details about ticket sales, financial aid, and more PyCon news! Thanks for your time! Brian Curtin, brian at python.org Publicity Coordinator, PyCon 2015 From wereapwhatwesow at gmail.com Tue Aug 19 15:31:05 2014 From: wereapwhatwesow at gmail.com (Steve Young) Date: Tue, 19 Aug 2014 08:31:05 -0500 Subject: [omaha] August Meeting Wednesday 8/20 7pm Message-ID: We are still in search of the 'perfect' meeting venue - please offer suggestions if you have a favorite place. On the agenda this month: - Interesting Python tips and tricks we have discovered recently - Bring your questions/problems you need help solving - Scheduling topics and discussions for the next few meetings. Fox Hollow Coffee has been an OK meeting place, but has no place for a projector. This is the tentative meeting spot until we have an alternative. Steve From dragonfyre13 at gmail.com Wed Aug 20 09:13:19 2014 From: dragonfyre13 at gmail.com (Tim Alexander) Date: Wed, 20 Aug 2014 02:13:19 -0500 Subject: [omaha] August Meeting Wednesday 8/20 7pm In-Reply-To: References: Message-ID: Darn, missed it today (just saw the email, also in the midst of a time consuming project). I'll do my best to make the next one though! On Tue, Aug 19, 2014 at 8:31 AM, Steve Young wrote: > We are still in search of the 'perfect' meeting venue - please offer > suggestions if you have a favorite place. > > On the agenda this month: > > - Interesting Python tips and tricks we have discovered recently > - Bring your questions/problems you need help solving > - Scheduling topics and discussions for the next few meetings. > > Fox Hollow Coffee has been an OK meeting place, but has no place for a > projector. This is the tentative meeting spot until we have an > alternative. > > Steve > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > https://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From wereapwhatwesow at gmail.com Wed Aug 20 14:03:32 2014 From: wereapwhatwesow at gmail.com (Steve Young) Date: Wed, 20 Aug 2014 07:03:32 -0500 Subject: [omaha] August Meeting Wednesday 8/20 7pm In-Reply-To: References: Message-ID: Tim - you are working too hard! The meeting is tonight - Wednesday! Steve On Wed, Aug 20, 2014 at 2:13 AM, Tim Alexander wrote: > Darn, missed it today (just saw the email, also in the midst of a time > consuming project). I'll do my best to make the next one though! > > > On Tue, Aug 19, 2014 at 8:31 AM, Steve Young > wrote: > > > We are still in search of the 'perfect' meeting venue - please offer > > suggestions if you have a favorite place. > > > > On the agenda this month: > > > > - Interesting Python tips and tricks we have discovered recently > > - Bring your questions/problems you need help solving > > - Scheduling topics and discussions for the next few meetings. > > > > Fox Hollow Coffee has been an OK meeting place, but has no place for a > > projector. This is the tentative meeting spot until we have an > > alternative. > > > > Steve > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > https://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > https://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From wereapwhatwesow at gmail.com Wed Aug 20 15:36:30 2014 From: wereapwhatwesow at gmail.com (Steve Young) Date: Wed, 20 Aug 2014 08:36:30 -0500 Subject: [omaha] August Meeting Wednesday 8/20 7pm In-Reply-To: References: Message-ID: New venue - a conference room at Gordmans in Aksarben thanks to Aaron Keck. Meeting starts at 7pm tonight, Wednesday, 8/20/14 Call 402-651-5215 if you have last minute communications. *Parking and entry details:* The building is the northwest corner of 67th and Frances and the Gordmans entrance is next to the "g" sign, about midway along the building. There's parking directly out front, but it sometimes fills up in the evenings. The garage around back is open to the public after 5:30 or 6 as well. The building doors lock at 5, so Aaron will be standing by to badge people in starting around 6:45. If you're running late, or early, just shoot him an email and I can meet you. Agenda so far: - Interesting Python tips and tricks we have discovered recently - Bring your questions/problems you need help solving - Scheduling topics and discussions for the next few meetings. Steve From jeffh at dundeemt.com Sun Aug 31 04:51:37 2014 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Sat, 30 Aug 2014 21:51:37 -0500 Subject: [omaha] [olug] Minecraft and Python programming... In-Reply-To: References: Message-ID: http://littlebytesofpi.com/index.php/resources/python-prog/python-minecraf/ Has a write up on python without pi. Might be what you're looking to achieve. On Aug 30, 2014 11:38 AM, "Dan Linder" wrote: > My daughters (13 and 8) are both big into watching Minecraft videos on > YouTube and playing occasionally. In an attempt to see if I can continue > to reach their geek, I thought about trying to help them write simple > Python scripts to build structures and/or geometric shapes along with other > automations. > > I am fairly certain that the Raspberry Pi version of Minecraft allows for > Python code to interact with the Minecraft world, but I can't find any > notes on how to do this (simply) on a Windows or Linux system. > > I found a few sites that setup a Java server running Minecraft and have a > hacked Python-to-Java (??) API, but the notes on that imply that this > breaks or changes each time a new version of Minecraft is released. I'd > also like something that is more-or-less self contained. > > Is the RPi the only real option, or have I overlooked a method to do this > on Windows/Linux? > > Thanks, > Dan > > -- > ***************** ************* *********** ******* ***** *** ** > "Quis custodiet ipsos custodes?" > (Who can watch the watchmen?) > -- from the Satires of Juvenal > "I do not fear computers, I fear the lack of them." > -- Isaac Asimov (Author) > ** *** ***** ******* *********** ************* ***************** > _______________________________________________ > OLUG mailing list > OLUG at olug.org > https://lists.olug.org/mailman/listinfo/olug > From wes.turner at gmail.com Sun Aug 31 14:43:10 2014 From: wes.turner at gmail.com (Wes Turner) Date: Sun, 31 Aug 2014 07:43:10 -0500 Subject: [omaha] [olug] Minecraft and Python programming... In-Reply-To: References: Message-ID: https://www.google.com/search?q=minecraft+python+site%3Agithub.com lists a number of Minecraft interfaces and reimplementations. http://www.reddit.com/r/Python/search?q=minecraft&restrict_sr=on http://www.reddit.com/r/learnpython/wiki/index lists quite a few general Python resources. On Aug 30, 2014 10:00 PM, "Jeff Hinrichs - DM&T" wrote: > http://littlebytesofpi.com/index.php/resources/python-prog/python-minecraf/ > > Has a write up on python without pi. Might be what you're looking to > achieve. > On Aug 30, 2014 11:38 AM, "Dan Linder" wrote: > > > My daughters (13 and 8) are both big into watching Minecraft videos on > > YouTube and playing occasionally. In an attempt to see if I can continue > > to reach their geek, I thought about trying to help them write simple > > Python scripts to build structures and/or geometric shapes along with > other > > automations. > > > > I am fairly certain that the Raspberry Pi version of Minecraft allows for > > Python code to interact with the Minecraft world, but I can't find any > > notes on how to do this (simply) on a Windows or Linux system. > > > > I found a few sites that setup a Java server running Minecraft and have a > > hacked Python-to-Java (??) API, but the notes on that imply that this > > breaks or changes each time a new version of Minecraft is released. I'd > > also like something that is more-or-less self contained. > > > > Is the RPi the only real option, or have I overlooked a method to do this > > on Windows/Linux? > > > > Thanks, > > Dan > > > > -- > > ***************** ************* *********** ******* ***** *** ** > > "Quis custodiet ipsos custodes?" > > (Who can watch the watchmen?) > > -- from the Satires of Juvenal > > "I do not fear computers, I fear the lack of them." > > -- Isaac Asimov (Author) > > ** *** ***** ******* *********** ************* ***************** > > _______________________________________________ > > OLUG mailing list > > OLUG at olug.org > > https://lists.olug.org/mailman/listinfo/olug > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > https://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From harmsc12 at yahoo.com Sun Aug 31 18:37:03 2014 From: harmsc12 at yahoo.com (Chris) Date: Sun, 31 Aug 2014 09:37:03 -0700 Subject: [omaha] [olug] Minecraft and Python programming... In-Reply-To: References: Message-ID: <1409503023.4102.YahooMailNeo@web162603.mail.bf1.yahoo.com> The only thing I can think of is setting up a Python script to output commands directly to a server console. I don't know how that would work, though, because I haven't run my own server yet. I do know you would have to know all the commands available in order to make it work. If you haven't already, I suggest checking out the page about commands on minecraft.gamepedia.net to see what you have available. On Saturday, August 30, 2014 9:51 PM, Jeff Hinrichs - DM&T wrote: http://littlebytesofpi.com/index.php/resources/python-prog/python-minecraf/ Has a write up on python without pi. Might be what you're looking to achieve. On Aug 30, 2014 11:38 AM, "Dan Linder" wrote: > My daughters (13 and 8) are both big into watching Minecraft videos on > YouTube and playing occasionally. In an attempt to see if I can continue > to reach their geek, I thought about trying to help them write simple > Python scripts to build structures and/or geometric shapes along with other > automations. > > I am fairly certain that the Raspberry Pi version of Minecraft allows for > Python code to interact with the Minecraft world, but I can't find any > notes on how to do this (simply) on a Windows or Linux system. > > I found a few sites that setup a Java server running Minecraft and have a > hacked Python-to-Java (??) API, but the notes on that imply that this > breaks or changes each time a new version of Minecraft is released. I'd > also like something that is more-or-less self contained. > > Is the RPi the only real option, or have I overlooked a method to do this > on Windows/Linux? > > Thanks, > Dan > > -- > ***************** ************* *********** ******* ***** *** ** > "Quis custodiet ipsos custodes?" > (Who can watch the watchmen?) > -- from the Satires of Juvenal > "I do not fear computers, I fear the lack of them." > -- Isaac Asimov (Author) > ** *** ***** ******* *********** ************* ***************** > _______________________________________________ > OLUG mailing list > OLUG at olug.org > https://lists.olug.org/mailman/listinfo/olug > _______________________________________________ OLUG mailing list OLUG at olug.org https://lists.olug.org/mailman/listinfo/olug