beginners guide
iam looking for a pdf to learn python iam using rasberry pi 3+.It comes with two software packages python 2.7.9 and python3.4.2
Thanks for any tips
/r/Python
https://redd.it/6z0ccr
iam looking for a pdf to learn python iam using rasberry pi 3+.It comes with two software packages python 2.7.9 and python3.4.2
Thanks for any tips
/r/Python
https://redd.it/6z0ccr
reddit
beginners guide • r/Python
iam looking for a pdf to learn python iam using rasberry pi 3+.It comes with two software packages python 2.7.9 and python3.4.2 Thanks for any tips
Help generating a form to fill out user profiles
Hello,
I'm building a user profile page in my django app and I have the user info in the database already. I extended the base User model with a OneToOneField like so:
**models.py**:
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
location = models.CharField(max_length=30, blank=True)
birthdate = models.DateField(null=True, blank=True)
...
# A few other custom fields
def __str__(self): # __unicode__ for Python 2
return self.user.username
Now I'm trying to give users the ability to edit their profiles so I created a form:
**forms.py**:
from django import forms
from models import UserProfile
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
exclude = ['user']
# I excluded 'user' because it renders as a dropdown with all the usernames from the database lol
I can place it in my profileUpdate.html template just fine, however I want to give users the ability to modify their first/last name from the User object but those items come from a different model. So, simple question I hope: how do I get the first/last name and email from the regular old django User model to be editable in this profile form? I wanted to use the model to generate the form so that I could use django's built in form validation.
If you need any more info please let me know. Thanks! :)
/r/django
https://redd.it/6z0l64
Hello,
I'm building a user profile page in my django app and I have the user info in the database already. I extended the base User model with a OneToOneField like so:
**models.py**:
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
location = models.CharField(max_length=30, blank=True)
birthdate = models.DateField(null=True, blank=True)
...
# A few other custom fields
def __str__(self): # __unicode__ for Python 2
return self.user.username
Now I'm trying to give users the ability to edit their profiles so I created a form:
**forms.py**:
from django import forms
from models import UserProfile
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
exclude = ['user']
# I excluded 'user' because it renders as a dropdown with all the usernames from the database lol
I can place it in my profileUpdate.html template just fine, however I want to give users the ability to modify their first/last name from the User object but those items come from a different model. So, simple question I hope: how do I get the first/last name and email from the regular old django User model to be editable in this profile form? I wanted to use the model to generate the form so that I could use django's built in form validation.
If you need any more info please let me know. Thanks! :)
/r/django
https://redd.it/6z0l64
reddit
Help generating a form to fill out user profiles • r/django
Hello, I'm building a user profile page in my django app and I have the user info in the database already. I extended the base User model with a...
Looking for advice on writing custom Django roles
Hello,
I need to build custom Django user roles, and i need an advise on the best approach (or library that i can use) to achieve that:
1. There will be 3 different user levels:
* Author
* Editor
* Verification
2. Every user must be limited to a city, based on custom field (New York, Berlin, Amsterdam, etc)
3. Only ‘Author’ can add content, while ‘Editor’ and ‘Verification’ can edit the content.
4. Author: Can only view/edit the content created by them.
5. Editor: Can only view/edit the content created by ‘Author’s in their cities.
6. Verification: Can only view/edit the content created by the ‘Editor’s in their cities.
7. Author: When creates content, should have the options to:
* Save as draft
* Send to Editor
8. Editor: When edits content, should have the options to:
* Send back to Author
* Send to Verification
9. Verification: When edits content, should have the options to:
* Send back to the Editor
* Mark as Verified.
**Scenario**
An admin creates the following users:
Username|Role|City|Content titles written by the user
:--|:--|:--|:--
John|Author|New York|Test1, Test2, Test3
Sam|Author|New York|Test4, Test5, Test6
Kim|Author|Berlin|Test7, Test8, Test9
Adam|Editor|New York
Alex|Editor|Berlin
Stacey|Verification|New York
Anthony|Verification|Berlin
Based on the above scenario, the Authors below should be able to access only the titles they created; Additionally:
* Adam: Should be able to view/edit the titles: Test1 - Test6 (Since they were written by 2 Authors in his City.
* Alex: Should be able to view/edit the titles: Test7 - Test9 (Since they were written by Kim, which in his city)
The same applies for the Verification.
Finally, If Author sent the content to Editor, the Author should no longer be able to edit the content, until it’s sent back to him by the Editor.
/r/django
https://redd.it/6z1oj4
Hello,
I need to build custom Django user roles, and i need an advise on the best approach (or library that i can use) to achieve that:
1. There will be 3 different user levels:
* Author
* Editor
* Verification
2. Every user must be limited to a city, based on custom field (New York, Berlin, Amsterdam, etc)
3. Only ‘Author’ can add content, while ‘Editor’ and ‘Verification’ can edit the content.
4. Author: Can only view/edit the content created by them.
5. Editor: Can only view/edit the content created by ‘Author’s in their cities.
6. Verification: Can only view/edit the content created by the ‘Editor’s in their cities.
7. Author: When creates content, should have the options to:
* Save as draft
* Send to Editor
8. Editor: When edits content, should have the options to:
* Send back to Author
* Send to Verification
9. Verification: When edits content, should have the options to:
* Send back to the Editor
* Mark as Verified.
**Scenario**
An admin creates the following users:
Username|Role|City|Content titles written by the user
:--|:--|:--|:--
John|Author|New York|Test1, Test2, Test3
Sam|Author|New York|Test4, Test5, Test6
Kim|Author|Berlin|Test7, Test8, Test9
Adam|Editor|New York
Alex|Editor|Berlin
Stacey|Verification|New York
Anthony|Verification|Berlin
Based on the above scenario, the Authors below should be able to access only the titles they created; Additionally:
* Adam: Should be able to view/edit the titles: Test1 - Test6 (Since they were written by 2 Authors in his City.
* Alex: Should be able to view/edit the titles: Test7 - Test9 (Since they were written by Kim, which in his city)
The same applies for the Verification.
Finally, If Author sent the content to Editor, the Author should no longer be able to edit the content, until it’s sent back to him by the Editor.
/r/django
https://redd.it/6z1oj4
reddit
Looking for advice on writing custom Django roles • r/django
Hello, I need to build custom Django user roles, and i need an advise on the best approach (or library that i can use) to achieve that: 1....
Good Django training resources for experienced developers in other languages?
I'm having a hard time finding django training resources geared towards people who already have experience with other languages / frameworks such as PHP/Symfony or Ruby. Does anyone have any recommendations?
Paid or free courses / books are would be fine... But bonus if something covers building apis with DRF...
/r/django
https://redd.it/6z1jzp
I'm having a hard time finding django training resources geared towards people who already have experience with other languages / frameworks such as PHP/Symfony or Ruby. Does anyone have any recommendations?
Paid or free courses / books are would be fine... But bonus if something covers building apis with DRF...
/r/django
https://redd.it/6z1jzp
reddit
Good Django training resources for experienced... • r/django
I'm having a hard time finding django training resources geared towards people who already have experience with other languages / frameworks such...
Slack CLI for productive developers
I just released v2.0.0 of my [slack-cli](https://pypi.org/project/slack-cli/) python package. Comments are welcome!
(also, this is my first ever reddit post \o/)
EDIT: missing link damn it
/r/Python
https://redd.it/6z1jt3
I just released v2.0.0 of my [slack-cli](https://pypi.org/project/slack-cli/) python package. Comments are welcome!
(also, this is my first ever reddit post \o/)
EDIT: missing link damn it
/r/Python
https://redd.it/6z1jt3
PyPI
slack-cli
Slack CLI for productive developers
Trying to build a date based app
Hi guys,
I'm trying to build an app where I can consult all of my swimming sessions. Every time I go swimming I upload the data from the watch to a mariadb database, adding one column with the date of the session like 2017-09-09.
Now I'm trying to build a django app where I can see the sessions organized by date. Like /2017/ shows all the sessions of this year, /2017/sep/ shows this month sessions, and /2017/sep/09 the data for this session.
This is my urls.py
url(r'^(?P<year_slug>[0-9]{4})/$', views.by_year, name='by_year'),
url(r'^(?P<year_slug>[0-9]{4})/(?P<month_slug>[\w-]+)/$', views.by_month, name='by_month'),
url(r'^(?P<year_slug>[0-9]{4})/(?P<month_slug>[\w-]+)/(?P<day_slug>[\w-]+)/$', views.by_day, name='by_day'),
I already kind of made it, I added three ForeignKey to my sessions model, pointing to Year, Month, and Day. Then I added three column to the database and added the value for each one, like if it's in 2017 it will be a 1, if it's in 2018 it's gonna be a two, and so on for months and days.
I feel like this is far from optimal. Can't I do that by using the 2017-09-09 which is in the date column, instead of adding three tables to the database?
Or is there even a totally different way to achieve this? (I tried {Year,Month,Day}ArchiveView but I wasn't able to make my own queries (like to get the total distance for one month)
My second question is, even if I go that way, I'm able to display the total distance for august in 2017/08/ by using the month_slug, but how can I do that in /2017/ ? I mean I understand I can't use the month_slug, but since I have sessions classed by month using {% ifchanged %}, isn't it possible to display the total distance for each month ?
I would appreciate some help here, thanks in advance and sorry for the wall of text.
/r/django
https://redd.it/6z3qxs
Hi guys,
I'm trying to build an app where I can consult all of my swimming sessions. Every time I go swimming I upload the data from the watch to a mariadb database, adding one column with the date of the session like 2017-09-09.
Now I'm trying to build a django app where I can see the sessions organized by date. Like /2017/ shows all the sessions of this year, /2017/sep/ shows this month sessions, and /2017/sep/09 the data for this session.
This is my urls.py
url(r'^(?P<year_slug>[0-9]{4})/$', views.by_year, name='by_year'),
url(r'^(?P<year_slug>[0-9]{4})/(?P<month_slug>[\w-]+)/$', views.by_month, name='by_month'),
url(r'^(?P<year_slug>[0-9]{4})/(?P<month_slug>[\w-]+)/(?P<day_slug>[\w-]+)/$', views.by_day, name='by_day'),
I already kind of made it, I added three ForeignKey to my sessions model, pointing to Year, Month, and Day. Then I added three column to the database and added the value for each one, like if it's in 2017 it will be a 1, if it's in 2018 it's gonna be a two, and so on for months and days.
I feel like this is far from optimal. Can't I do that by using the 2017-09-09 which is in the date column, instead of adding three tables to the database?
Or is there even a totally different way to achieve this? (I tried {Year,Month,Day}ArchiveView but I wasn't able to make my own queries (like to get the total distance for one month)
My second question is, even if I go that way, I'm able to display the total distance for august in 2017/08/ by using the month_slug, but how can I do that in /2017/ ? I mean I understand I can't use the month_slug, but since I have sessions classed by month using {% ifchanged %}, isn't it possible to display the total distance for each month ?
I would appreciate some help here, thanks in advance and sorry for the wall of text.
/r/django
https://redd.it/6z3qxs
reddit
Trying to build a date based app • r/django
Hi guys, I'm trying to build an app where I can consult all of my swimming sessions. Every time I go swimming I upload the data from the watch to...
Detailed Flask Web Development Series
Hey guys,
I’ve been working on building a really detailed course around the Flask framework to get many beginners started with web development with Python.
Course Page: https://www.thecodewolf.com/courses/python-flask-web-development/
Here are the first few videos of the series, I’ve also have written tutorials with the videos as well:
* Overview & Installation
* [Video](https://youtu.be/Ty2qAlDsAxc)
* [Blog Post](https://www.thecodewolf.com/introduction-to-python-flask-web-development-overview-of-flask/)
* Hello World & Flask Application Structure
* [Video](https://youtu.be/OrTWfZpv0i0)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-hello-world-flask-application-structure/)
* Flask Templates, Jinja2 Tutorial, Bootstrap Integration, and Custom Error Pages
* [Video](https://youtu.be/0M74EGmqWIY)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-flask-templates-and-flask-bootstrap-integration/)
The next few videos and guides will be coming out in the next few days/weeks, and I’ll be releasing new content on a regular basis.
**My goal is to create the best foundational web development course with the Flask framework to get as many people started with Flask as a stepping stone in web development with Python.**
If you guys enjoy the content, I will also be working on a detailed series like this with Django as well.
Here are some of the following videos that will be coming up with the series:
* Web Forms with Flask
* Database Integrations with Flask
Then I will be working on content that will actually have you build a complete blog application with users, blog posts, and all sorts of other really cool stuff.
With the current content so far, I would love to hear some feedback as well.
~ CW
/r/Python
https://redd.it/6z5jkx
Hey guys,
I’ve been working on building a really detailed course around the Flask framework to get many beginners started with web development with Python.
Course Page: https://www.thecodewolf.com/courses/python-flask-web-development/
Here are the first few videos of the series, I’ve also have written tutorials with the videos as well:
* Overview & Installation
* [Video](https://youtu.be/Ty2qAlDsAxc)
* [Blog Post](https://www.thecodewolf.com/introduction-to-python-flask-web-development-overview-of-flask/)
* Hello World & Flask Application Structure
* [Video](https://youtu.be/OrTWfZpv0i0)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-hello-world-flask-application-structure/)
* Flask Templates, Jinja2 Tutorial, Bootstrap Integration, and Custom Error Pages
* [Video](https://youtu.be/0M74EGmqWIY)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-flask-templates-and-flask-bootstrap-integration/)
The next few videos and guides will be coming out in the next few days/weeks, and I’ll be releasing new content on a regular basis.
**My goal is to create the best foundational web development course with the Flask framework to get as many people started with Flask as a stepping stone in web development with Python.**
If you guys enjoy the content, I will also be working on a detailed series like this with Django as well.
Here are some of the following videos that will be coming up with the series:
* Web Forms with Flask
* Database Integrations with Flask
Then I will be working on content that will actually have you build a complete blog application with users, blog posts, and all sorts of other really cool stuff.
With the current content so far, I would love to hear some feedback as well.
~ CW
/r/Python
https://redd.it/6z5jkx
I wrote a library that automatically formats help messages for your program and integrates with Sphinx. Feedback is greatly appreciated :-)
https://github.com/lostatc/linotype
/r/Python
https://redd.it/6z3wfz
https://github.com/lostatc/linotype
/r/Python
https://redd.it/6z3wfz
GitHub
lostatc/linotype
linotype - Automatically format help messages.
Why create more than one url files?
So i'd like to began by saying i'm a total noob in django and web development. I started taking the trydjango1.11 series available on youtube. It's well taught and explained.
In the series, they only configure the urls in the root folder of our projec where the main url file is located. The other day i was browsing other people's tutorials and django's documents and i noticed that they made two url files. The one which was already available in the project folder, and the other they made in their app's folder.
I don't understand the point of this. The series i'm watching works perfectly with only one url file which is in the root of the project's folder.
As english is not my first language, i hope you could understand my question. Any sort of help is appreciated :)
/r/djangolearning
https://redd.it/6z0kdd
So i'd like to began by saying i'm a total noob in django and web development. I started taking the trydjango1.11 series available on youtube. It's well taught and explained.
In the series, they only configure the urls in the root folder of our projec where the main url file is located. The other day i was browsing other people's tutorials and django's documents and i noticed that they made two url files. The one which was already available in the project folder, and the other they made in their app's folder.
I don't understand the point of this. The series i'm watching works perfectly with only one url file which is in the root of the project's folder.
As english is not my first language, i hope you could understand my question. Any sort of help is appreciated :)
/r/djangolearning
https://redd.it/6z0kdd
reddit
Why create more than one url files? • r/djangolearning
So i'd like to began by saying i'm a total noob in django and web development. I started taking the trydjango1.11 series available on youtube....
When creating a "Vote" system should you store count or is subtracting downvotes from upvotes fine?
I'm looking to create a basic voting system for some objects. My model looks like:
class Model(models.Model):
obj = models.ForeignKey('obj.Obj')
user = models.ForeignKey('users.User')
upvotes = models.PositiveIntegerField(default=0)
downvotes = models.PositiveIntegerField(default=0)
count = models.IntegerField(default=0)
I was just wondering do i need the `count` field or could i just rely on using something like
@cached_property
def count(self):
return self.upvotes - self.downvotes
If i should store a count field, why is that?
/r/django
https://redd.it/6z3wh6
I'm looking to create a basic voting system for some objects. My model looks like:
class Model(models.Model):
obj = models.ForeignKey('obj.Obj')
user = models.ForeignKey('users.User')
upvotes = models.PositiveIntegerField(default=0)
downvotes = models.PositiveIntegerField(default=0)
count = models.IntegerField(default=0)
I was just wondering do i need the `count` field or could i just rely on using something like
@cached_property
def count(self):
return self.upvotes - self.downvotes
If i should store a count field, why is that?
/r/django
https://redd.it/6z3wh6
reddit
When creating a "Vote" system should you store count or... • r/django
I'm looking to create a basic voting system for some objects. My model looks like: class Model(models.Model): obj =...
Make a Programming Language Using Python (Not my channel,just shared for those who are probably interested).
https://www.youtube.com/watch?v=9tSuJzwe9Ok
/r/Python
https://redd.it/6z5red
https://www.youtube.com/watch?v=9tSuJzwe9Ok
/r/Python
https://redd.it/6z5red
YouTube
Making a Programming Language in Python - Part 1 - Getting Started
This is the first video beginning a new video series on making a high level programming language from scratch using python. Tachyon Github Link - https://git...
Help with adding javascript to django templates
Today was my first attempt at adding javascript to a django template. I've tried to load the javascript in my base template, then I included a bunch of script inside another template. Part of the base.html is as follows, it is generally working because I know that my css files get loaded:
<!DOCTYPE html>
<html lang="en">
{% block head %}<head>{% load static %}
<meta charset="utf-8">
<!-- CSS
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="{% static "css/normalize.css" %}">
<link rel="stylesheet" href="{% static "css/skeleton.css" %}">
<link rel="stylesheet" href="{% static "css/layout.css" %}">
<!-- JAVASCRIPT
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<script type="text/javascript" language="Javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.11.3.min.js"></script>
</head>
{% endblock %}
And here is the template that is supposed to have the javascript working:
{% extends 'classroom/base.html' %}
{% block body %}
<div class="container">
<div class="row">
<div class="twelve columns">
<h1>Choose the block</h1>
</div>
</div>
<div class="row">
<div class="twelve columns">
{{ classroom.id }}
<form action="{% url 'classroom:random' %}" method="get">
<select name="class_block">
{% for room in classroom %}
<option value={{ room.course_block }}>{{ room.get_course_block_display }}</option>
{% endfor %}
</select>
<input type="submit" value="submit" />
</form>
</div>
</div>
<div class="row">
<div class="one-third columns">
test
{% for s in students %}
<ul>
<li>{{ s.nickname }}</li>
</ul>
{% endfor %}
</div>
</div>
<div class="row">
<div class="twelve columns">
<script>
var nameArray = [
"Jimmy",
"Sonny",
"Sammy",
"Henry",
"Hank",
"Susan",
"Sebby",
"Alyssa",
"Pepper",
"Ken",
"Steve",
"Kandi",
"Wes"
];
var numberStudents = nameArray.length;
var interval;
for(n = 0; n < numberStudents; n++){
var divName = "floatName" + n;
console.log(divName);
var names = nameArray[n];
var divTag = document.createElement('div');
divTag.id = divName;
divTag.innerHTML = names;
divTag.style.position = "absolute";
divTag.style.top = 50 + n*20 + "px";
divTag.style.left = "50px";
divTag.className = "randomFloat";
document.body.appendChild(divTag);
};
var loopAllowed = false;
$( "#go" ).click(function() {
loopAllowed = true;
var max = 12;
var loop = function(){
for(i = 0; i < (numberStudents + 1); i++){
var divName = "floatName" + i;
console.log(divName);
$( "#" + divName ).animate({
left: Math.random()*500 + "px",
top: Math.random()*500 + "px"
}, 500, i == max - 1 && loopAllowed ? loop : undefined);
}
};
loop();
});
$( "#stop" ).click(function() {
loopAllowed = false;
});
</script>
</div>
</div>
</div>
{% endblock %}
The parts inside <script></script> work when its loaded into a browser on its own. Inside this template though, nothing is happening.
/r/django
https://redd.it/6z38c1
Today was my first attempt at adding javascript to a django template. I've tried to load the javascript in my base template, then I included a bunch of script inside another template. Part of the base.html is as follows, it is generally working because I know that my css files get loaded:
<!DOCTYPE html>
<html lang="en">
{% block head %}<head>{% load static %}
<meta charset="utf-8">
<!-- CSS
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="{% static "css/normalize.css" %}">
<link rel="stylesheet" href="{% static "css/skeleton.css" %}">
<link rel="stylesheet" href="{% static "css/layout.css" %}">
<!-- JAVASCRIPT
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<script type="text/javascript" language="Javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.11.3.min.js"></script>
</head>
{% endblock %}
And here is the template that is supposed to have the javascript working:
{% extends 'classroom/base.html' %}
{% block body %}
<div class="container">
<div class="row">
<div class="twelve columns">
<h1>Choose the block</h1>
</div>
</div>
<div class="row">
<div class="twelve columns">
{{ classroom.id }}
<form action="{% url 'classroom:random' %}" method="get">
<select name="class_block">
{% for room in classroom %}
<option value={{ room.course_block }}>{{ room.get_course_block_display }}</option>
{% endfor %}
</select>
<input type="submit" value="submit" />
</form>
</div>
</div>
<div class="row">
<div class="one-third columns">
test
{% for s in students %}
<ul>
<li>{{ s.nickname }}</li>
</ul>
{% endfor %}
</div>
</div>
<div class="row">
<div class="twelve columns">
<script>
var nameArray = [
"Jimmy",
"Sonny",
"Sammy",
"Henry",
"Hank",
"Susan",
"Sebby",
"Alyssa",
"Pepper",
"Ken",
"Steve",
"Kandi",
"Wes"
];
var numberStudents = nameArray.length;
var interval;
for(n = 0; n < numberStudents; n++){
var divName = "floatName" + n;
console.log(divName);
var names = nameArray[n];
var divTag = document.createElement('div');
divTag.id = divName;
divTag.innerHTML = names;
divTag.style.position = "absolute";
divTag.style.top = 50 + n*20 + "px";
divTag.style.left = "50px";
divTag.className = "randomFloat";
document.body.appendChild(divTag);
};
var loopAllowed = false;
$( "#go" ).click(function() {
loopAllowed = true;
var max = 12;
var loop = function(){
for(i = 0; i < (numberStudents + 1); i++){
var divName = "floatName" + i;
console.log(divName);
$( "#" + divName ).animate({
left: Math.random()*500 + "px",
top: Math.random()*500 + "px"
}, 500, i == max - 1 && loopAllowed ? loop : undefined);
}
};
loop();
});
$( "#stop" ).click(function() {
loopAllowed = false;
});
</script>
</div>
</div>
</div>
{% endblock %}
The parts inside <script></script> work when its loaded into a browser on its own. Inside this template though, nothing is happening.
/r/django
https://redd.it/6z38c1
Twisted is 93% ported to Python 3
https://www.slideshare.net/CraigRodrigues1/the-onward-journey-porting-twisted-to-python-3
https://www.youtube.com/watch?v=ZbYvtibFymM
/r/Python
https://redd.it/6z6wst
https://www.slideshare.net/CraigRodrigues1/the-onward-journey-porting-twisted-to-python-3
https://www.youtube.com/watch?v=ZbYvtibFymM
/r/Python
https://redd.it/6z6wst
www.slideshare.net
The Onward Journey: Porting Twisted to Python 3
This presentation discusses some of the work I did to port parts of the Twisted library to Python 3.
Auto setting a thumbnail to an album model
Hey guys,
I'm working on a project where I have photo albums and each album has it's pictures (with a ForeignKey to the album model). How can I pull the first image of the album and set it as the thumbnail of the album?
I'm thinking about setting up a view function that checks if there are any images in the model, and if there is, it pulls one of these images and defines it as a thumb. But I'm not sure how to do it exactly.
/r/django
https://redd.it/6z24dj
Hey guys,
I'm working on a project where I have photo albums and each album has it's pictures (with a ForeignKey to the album model). How can I pull the first image of the album and set it as the thumbnail of the album?
I'm thinking about setting up a view function that checks if there are any images in the model, and if there is, it pulls one of these images and defines it as a thumb. But I'm not sure how to do it exactly.
/r/django
https://redd.it/6z24dj
reddit
Auto setting a thumbnail to an album model • r/django
Hey guys, I'm working on a project where I have photo albums and each album has it's pictures (with a ForeignKey to the album model). How can I...
Building a graph of flights from airport codes in tweets
https://nvbn.github.io/2017/09/10/airports-graph/
/r/Python
https://redd.it/6z7tli
https://nvbn.github.io/2017/09/10/airports-graph/
/r/Python
https://redd.it/6z7tli
nvbn.github.io
Building a graph of flights from airport codes in tweets
A lot of people (at least me) tweet airports codes like PRG ✈ AMS
before flights. So I thought it will be interesting to draw a
directed graph of flights and airports. Where airports are nodes
and ...
before flights. So I thought it will be interesting to draw a
directed graph of flights and airports. Where airports are nodes
and ...
We are the Google Brain team. We’d love to answer your questions (again)
We had so much fun at our [2016 AMA](https://www.reddit.com/r/MachineLearning/comments/4w6tsv/ama_we_are_the_google_brain_team_wed_love_to/) that we’re back again!
We are a group of research scientists and engineers that work on the Google Brain team. You can learn more about us and our work at [g.co/brain](http://g.co/brain), including a [list of our publications](https://research.google.com/pubs/BrainTeam.html), our [blog posts](https://research.googleblog.com/search/label/Google%20Brain), our [team's mission and culture](https://research.google.com/teams/brain/about.html), some of our particular areas of research, and can read about the experiences of our first cohort of [Google Brain Residents](http://g.co/brainresidency) who “graduated” in June of 2017.
You can also learn more about the TensorFlow system that our group open-sourced at [tensorflow.org](http://tensorflow.org) in November, 2015. In less than two years since its open-source release, TensorFlow has attracted a vibrant community of developers, machine learning researchers and practitioners from all across the globe.
We’re excited to talk to you about our work, including topics like creating machines that [learn how to learn](https://research.google.com/pubs/pub45826.html), enabling people to [explore deep learning right in their browsers](https://research.googleblog.com/2017/08/harness-power-of-machine-learning-in.html), Google's custom machine learning TPU chips and systems ([TPUv1](https://arxiv.org/abs/1704.04760) and [TPUv2](http://g.co/tpu)), use of machine learning for [robotics](http://g.co/brain/robotics) and [healthcare](http://g.co/brain/healthcare), our papers accepted to [ICLR 2017](https://research.googleblog.com/2017/04/research-at-google-and-iclr-2017.html), [ICML 2017](https://research.googleblog.com/2017/08/google-at-icml-2017.html) and NIPS 2017 (public list to be posted soon), and anything else you all want to discuss.
We're posting this a few days early to collect your questions here, and we’ll be online for much of the day on September 13, 2017, starting at around 9 AM PDT to answer your questions.
/r/MachineLearning
https://redd.it/6z51xb
We had so much fun at our [2016 AMA](https://www.reddit.com/r/MachineLearning/comments/4w6tsv/ama_we_are_the_google_brain_team_wed_love_to/) that we’re back again!
We are a group of research scientists and engineers that work on the Google Brain team. You can learn more about us and our work at [g.co/brain](http://g.co/brain), including a [list of our publications](https://research.google.com/pubs/BrainTeam.html), our [blog posts](https://research.googleblog.com/search/label/Google%20Brain), our [team's mission and culture](https://research.google.com/teams/brain/about.html), some of our particular areas of research, and can read about the experiences of our first cohort of [Google Brain Residents](http://g.co/brainresidency) who “graduated” in June of 2017.
You can also learn more about the TensorFlow system that our group open-sourced at [tensorflow.org](http://tensorflow.org) in November, 2015. In less than two years since its open-source release, TensorFlow has attracted a vibrant community of developers, machine learning researchers and practitioners from all across the globe.
We’re excited to talk to you about our work, including topics like creating machines that [learn how to learn](https://research.google.com/pubs/pub45826.html), enabling people to [explore deep learning right in their browsers](https://research.googleblog.com/2017/08/harness-power-of-machine-learning-in.html), Google's custom machine learning TPU chips and systems ([TPUv1](https://arxiv.org/abs/1704.04760) and [TPUv2](http://g.co/tpu)), use of machine learning for [robotics](http://g.co/brain/robotics) and [healthcare](http://g.co/brain/healthcare), our papers accepted to [ICLR 2017](https://research.googleblog.com/2017/04/research-at-google-and-iclr-2017.html), [ICML 2017](https://research.googleblog.com/2017/08/google-at-icml-2017.html) and NIPS 2017 (public list to be posted soon), and anything else you all want to discuss.
We're posting this a few days early to collect your questions here, and we’ll be online for much of the day on September 13, 2017, starting at around 9 AM PDT to answer your questions.
/r/MachineLearning
https://redd.it/6z51xb
Reddit
From the MachineLearning community on Reddit: AMA: We are the Google Brain team. We'd love to answer your questions about machine…
Explore this post and more from the MachineLearning community
OLS model in Python; how to find correlation between gender and 20 specific diseases?
Apologies for the bad explanations, I am really confused and clueless.
As the title states, I am trying to find the correlation but I am having some difficulties with the work before running the model.
I have male, female, 20 different diseases "as the columns" and patients on the rows. I have "dummied" it down to 0.0 or 1.0,
ex:
Male Female D1 D2
P1 0.0 , 1.0 , 0.0 , 1.0
P1 is female with disease D2.
I want to use the model to find which disease(s) have a higher correlation to males.
Now I am clueless to the steps to find the correlation....For the first time, I would appreciate answers which is "dummyed" down for me hehehe
/r/pystats
https://redd.it/6z8tyl
Apologies for the bad explanations, I am really confused and clueless.
As the title states, I am trying to find the correlation but I am having some difficulties with the work before running the model.
I have male, female, 20 different diseases "as the columns" and patients on the rows. I have "dummied" it down to 0.0 or 1.0,
ex:
Male Female D1 D2
P1 0.0 , 1.0 , 0.0 , 1.0
P1 is female with disease D2.
I want to use the model to find which disease(s) have a higher correlation to males.
Now I am clueless to the steps to find the correlation....For the first time, I would appreciate answers which is "dummyed" down for me hehehe
/r/pystats
https://redd.it/6z8tyl
reddit
OLS model in Python; how to find correlation between... • r/pystats
Apologies for the bad explanations, I am really confused and clueless. As the title states, I am trying to find the correlation but I am having...
Jupyter4kids – Notebooks to help teach kids principles of programming
https://github.com/mikkokotila/jupyter4kids
/r/Python
https://redd.it/6z8mb9
https://github.com/mikkokotila/jupyter4kids
/r/Python
https://redd.it/6z8mb9
GitHub
eka-foundation/numerical-computing-is-fun
Learning numerical computing with notebooks for all ages. - eka-foundation/numerical-computing-is-fun
Hydro Flask | Review| is it worth it? (honest)
https://www.youtube.com/attribution_link?a=W_smfDiZ8aU&u=%2Fwatch%3Fv%3DZ4gJFfgDMAA%26feature%3Dshare
/r/flask
https://redd.it/6zb4c5
https://www.youtube.com/attribution_link?a=W_smfDiZ8aU&u=%2Fwatch%3Fv%3DZ4gJFfgDMAA%26feature%3Dshare
/r/flask
https://redd.it/6zb4c5
YouTube
Hydro Flask | Review| is it worth it? (honest)
I purchased the 40 ounce, straw lid hydro flak. Ive never had a yetti water bottle, so this is my first time experiencing an item like this. I do love that m...
Animated routes with QGIS and Python
https://medium.com/@tjukanov/animated-routes-with-qgis-9377c1f16021
/r/Python
https://redd.it/6z9gwk
https://medium.com/@tjukanov/animated-routes-with-qgis-9377c1f16021
/r/Python
https://redd.it/6z9gwk
Medium
Animated routes with QGIS
I have been posting these GIF animations with the theme Optimal routes from x to n locations already for a while to my Twitter account and…