Asyncio event loop written in Rust language
I'd like to announce new event loop, written in Rust language.
https://github.com/PyO3/tokio
It is still in alpha stage. It provides most of asyncio event loop apis, except udp. TCP api is more or less stable, Aiohttp tests pass with tokio loop (~1800 tests). I am planing to run more tests from other libraries.
Performance wise it should be close to uvloop.
But main motivation behind this project is to be able to mix Rust code with Python. Internal implementation still requires
more thinking, but it is already possible to to wait for python task/future completion in rust code and opposite.
Project is still in early stage of development, if anyone interested, everyone welcome to join.
/r/Python
https://redd.it/6ael2m
I'd like to announce new event loop, written in Rust language.
https://github.com/PyO3/tokio
It is still in alpha stage. It provides most of asyncio event loop apis, except udp. TCP api is more or less stable, Aiohttp tests pass with tokio loop (~1800 tests). I am planing to run more tests from other libraries.
Performance wise it should be close to uvloop.
But main motivation behind this project is to be able to mix Rust code with Python. Internal implementation still requires
more thinking, but it is already possible to to wait for python task/future completion in rust code and opposite.
Project is still in early stage of development, if anyone interested, everyone welcome to join.
/r/Python
https://redd.it/6ael2m
GitHub
GitHub - PyO3/tokio: Asyncio event loop written in Rust language
Asyncio event loop written in Rust language. Contribute to PyO3/tokio development by creating an account on GitHub.
Testing serialization independently from views (DRF)
How would one go about testing serialization independent of my views?
In other words, just hardcoding a Django model object and using the serializer.
Problem is that HyperLinkedIdentityField is throwing an error saying to add the request to the context (I am using HyperlinkedModelSerializers). I do this in my views, but I don't want to introduce views here. If I simulate a post request, then I'll have to go through my views.
Is there a way around this?
I still consider myself a noob with testing and have never done testing with API's beyond manually testing my API endpoints, so I'd appreciate any general advice.
Thanks!
/r/django
https://redd.it/6afevz
How would one go about testing serialization independent of my views?
In other words, just hardcoding a Django model object and using the serializer.
Problem is that HyperLinkedIdentityField is throwing an error saying to add the request to the context (I am using HyperlinkedModelSerializers). I do this in my views, but I don't want to introduce views here. If I simulate a post request, then I'll have to go through my views.
Is there a way around this?
I still consider myself a noob with testing and have never done testing with API's beyond manually testing my API endpoints, so I'd appreciate any general advice.
Thanks!
/r/django
https://redd.it/6afevz
reddit
Testing serialization independently from views (DRF) • r/django
How would one go about testing serialization independent of my views? In other words, just hardcoding a Django model object and using the...
Creating CRUD Interface with SQLAlchemy
Im in the middle of doing a small project. Right now, I have a flask application that is connecting to a SQLAlchemy database and Im able to use a form to add new entries to that database. I also have a page [here](http://imgur.com/a/PJ6fK) that displays the values that are being held by the SQL database.
However, now I want to turn the page that is showing the data into a CRUD interface so i am able to not so much create new entries but to read, update current data thats being stored and delete entries as well. (More like a RUD design :P)
I have looked all over the web for a simple example of someone doing this in SQLAlchemy & Flask but haven't really come across anything decent. Does anyone know of any examples I can look at to do this simply? I've looked at the SQLAlchemy docs but it doesnt really show how to do it using Jinja templates and im relatively new to all this so need as much help as I can get.
/r/flask
https://redd.it/6adlzf
Im in the middle of doing a small project. Right now, I have a flask application that is connecting to a SQLAlchemy database and Im able to use a form to add new entries to that database. I also have a page [here](http://imgur.com/a/PJ6fK) that displays the values that are being held by the SQL database.
However, now I want to turn the page that is showing the data into a CRUD interface so i am able to not so much create new entries but to read, update current data thats being stored and delete entries as well. (More like a RUD design :P)
I have looked all over the web for a simple example of someone doing this in SQLAlchemy & Flask but haven't really come across anything decent. Does anyone know of any examples I can look at to do this simply? I've looked at the SQLAlchemy docs but it doesnt really show how to do it using Jinja templates and im relatively new to all this so need as much help as I can get.
/r/flask
https://redd.it/6adlzf
Imgur
Imgur: The most awesome images on the Internet
Imgur: The most awesome images on the Internet.
Python support is now stable in Visual Studio 2017
https://blogs.msdn.microsoft.com/pythonengineering/2017/05/10/python-now-stable-in-vs-2017/
/r/Python
https://redd.it/6ag8pq
https://blogs.msdn.microsoft.com/pythonengineering/2017/05/10/python-now-stable-in-vs-2017/
/r/Python
https://redd.it/6ag8pq
Question about Django Rest Auth and Users
I am using Django Rest Auth endpoints and DRF for learning. I created a basic To-Do app and it works just fine but after I have new users register, I would like them to be able to do basic CRUD operations on their own tasks.
Because I am using Django Rest Auth to register users, is there anything special I need to override? How would I go about achieving this goal?
I feel like this may be an easy problem to solve but I'm having trouble. I've tried adding to views.py
permission_classes = (IsAuthenticated,)
but does not work.
Thanks for any help!
/r/django
https://redd.it/6ahge2
I am using Django Rest Auth endpoints and DRF for learning. I created a basic To-Do app and it works just fine but after I have new users register, I would like them to be able to do basic CRUD operations on their own tasks.
Because I am using Django Rest Auth to register users, is there anything special I need to override? How would I go about achieving this goal?
I feel like this may be an easy problem to solve but I'm having trouble. I've tried adding to views.py
permission_classes = (IsAuthenticated,)
but does not work.
Thanks for any help!
/r/django
https://redd.it/6ahge2
reddit
Question about Django Rest Auth and Users • r/django
I am using Django Rest Auth endpoints and DRF for learning. I created a basic To-Do app and it works just fine but after I have new users...
62 video tutorials on Django by Max Goodridge
https://www.youtube.com/playlist?list=PLw02n0FEB3E3VSHjyYMcFadtQORvl1Ssj
/r/django
https://redd.it/6aiio0
https://www.youtube.com/playlist?list=PLw02n0FEB3E3VSHjyYMcFadtQORvl1Ssj
/r/django
https://redd.it/6aiio0
YouTube
Django Tutorials
Share your videos with friends, family, and the world
Example of CRUD with Flask to manage a contact list.
https://github.com/tanrax/flask-contacts
/r/flask
https://redd.it/6ai9eg
https://github.com/tanrax/flask-contacts
/r/flask
https://redd.it/6ai9eg
GitHub
GitHub - tanrax/flask-contacts: Example of CRUD with Flask to manage a contact list.
Example of CRUD with Flask to manage a contact list. - GitHub - tanrax/flask-contacts: Example of CRUD with Flask to manage a contact list.
Scaling Python/Flask Microservices with Kubernetes
http://blog.apcelent.com/scaling-python-microservices-kubernetes.html
/r/Python
https://redd.it/6ai6oo
http://blog.apcelent.com/scaling-python-microservices-kubernetes.html
/r/Python
https://redd.it/6ai6oo
reddit
Scaling Python/Flask Microservices with Kubernetes • r/Python
13 points and 2 comments so far on reddit
Python overtakes PHP on Stackoverflow
https://stackoverflow.blog/2017/05/09/introducing-stack-overflow-trends/?cb=1
/r/Python
https://redd.it/6ad0r0
https://stackoverflow.blog/2017/05/09/introducing-stack-overflow-trends/?cb=1
/r/Python
https://redd.it/6ad0r0
Stack Overflow Blog
Introducing Stack Overflow Trends - Stack Overflow Blog
On a typical day, developers ask over 8,000 questions on Stack Overflow about programming problems they run into in their work. Which technologies are they asking about, and how has that changed over time?
SQLAlchemy filter similar entries
I'm asking myself how to implement a proper search function. For example in the case of a User database model created with sqlalchemy. How would I do a filter request searching for similar names as the given one?
E.g.:
User.query.filter_by(name="Tina").all()
# gets all users with the name "Tina"
But what if I want to get all users with a similar name as well? E.g. "Tine", "Lina"
Is there something more efficient than looping through the name letters replacing it with % and do like or ilike queries?
/r/flask
https://redd.it/6ajk76
I'm asking myself how to implement a proper search function. For example in the case of a User database model created with sqlalchemy. How would I do a filter request searching for similar names as the given one?
E.g.:
User.query.filter_by(name="Tina").all()
# gets all users with the name "Tina"
But what if I want to get all users with a similar name as well? E.g. "Tine", "Lina"
Is there something more efficient than looping through the name letters replacing it with % and do like or ilike queries?
/r/flask
https://redd.it/6ajk76
reddit
SQLAlchemy filter similar entries • r/flask
I'm asking myself how to implement a proper search function. For example in the case of a User database model created with sqlalchemy. How would I...
Spyder causing tons of terminal/console windows to rapidly open and close. WHy and how do I fix it?
The title pretty much says it all. This happens with a whole range of things I try to do, and actually it seems like everything I do causes this.
The only other information I can provide, is that the file address in the "Title" bar of the terminal window ends in "tput.exe", but it's opening and closing so rapidly (and so many times) that I have a hard time making out anything else. Anyone know whats up?
To clarify, I just ran `x = []` and had to wait 10 seconds for a ton of terminal windows to open and close. It's SUPER annoying.
/r/IPython
https://redd.it/6al4pv
The title pretty much says it all. This happens with a whole range of things I try to do, and actually it seems like everything I do causes this.
The only other information I can provide, is that the file address in the "Title" bar of the terminal window ends in "tput.exe", but it's opening and closing so rapidly (and so many times) that I have a hard time making out anything else. Anyone know whats up?
To clarify, I just ran `x = []` and had to wait 10 seconds for a ton of terminal windows to open and close. It's SUPER annoying.
/r/IPython
https://redd.it/6al4pv
reddit
Spyder causing tons of terminal/console windows to... • r/IPython
The title pretty much says it all. This happens with a whole range of things I try to do, and actually it seems like everything I do causes...
The future is looking bright for Python
https://medium.com/@trstringer/the-future-is-looking-bright-for-python-95a748a4ef3e
/r/Python
https://redd.it/6ak20v
https://medium.com/@trstringer/the-future-is-looking-bright-for-python-95a748a4ef3e
/r/Python
https://redd.it/6ak20v
Medium
The future is looking bright for Python
Stack Overflow recently released a cool new tool called Trends. This tool allows you to compare Stack Overflow question tags over the…
Edit form with WTForm and Sqlalchemy
Using WTForm, how can I fill all fields from Sqlalchemy? I'm improving a CRUD.
Now I use
```{{ form.name(class='form-control', value=my_contact.name) }}```
/r/flask
https://redd.it/6alei3
Using WTForm, how can I fill all fields from Sqlalchemy? I'm improving a CRUD.
Now I use
```{{ form.name(class='form-control', value=my_contact.name) }}```
/r/flask
https://redd.it/6alei3
reddit
Edit form with WTForm and Sqlalchemy • r/flask
Using WTForm, how can I fill all fields from Sqlalchemy? I'm improving a CRUD. Now I use ```{{ form.name(class='form-control',...
Machine Learning Explained with GIFs
https://dashee87.github.io/data%20science/general/Clustering-with-Scikit-with-GIFs/
/r/Python
https://redd.it/6aku0r
https://dashee87.github.io/data%20science/general/Clustering-with-Scikit-with-GIFs/
/r/Python
https://redd.it/6aku0r
dashee87.github.io
Clustering with Scikit with GIFs
This posts describes (with GIFs and words) the most common clustering algorithms available through Scikit-learn.
It doesn't recognize that there is a terrain folder but it does on my ubuntu computer
https://github.com/DeaSTL/openGL-sandbox
/r/Python
https://redd.it/6anv3r
https://github.com/DeaSTL/openGL-sandbox
/r/Python
https://redd.it/6anv3r
GitHub
DeaSTL/openGL-sandbox
Contribute to openGL-sandbox development by creating an account on GitHub.
Trouble getting Filtering working with ViewSet
I'm relatively new to Django but generally have figured out how to use filtering quite effectively. However, I have encountered a situation that I can't resolve:
class FeatureStatsViewSet(ModelViewSet):
queryset = FeatureStats.objects.all()
serializer_class = FeatureStatsSerializer
permission_classes = (permissions.IsAuthenticated,)
# TODO: Not sure why this is only returning one record during testing!
def get_queryset(self):
user = self.request.user
pipelines = Pipeline.objects.filter(createdBy=user.id)
features = Feature.objects.filter(pipeline=pipelines)
return FeatureStats.objects.filter(feature=features)
#return FeatureStats.objects.all()
What this code is supposed to do is return 'FeatureStats' for the currently authenticated user. My approach has worked correctly for lots of other tables but not for this one.
"FeatureStats.objects.all()" returns all 10 records in my test data, which is correct.
"FeatureStats.objects.filter(feature=features)" is supposed to return 9 records, which are the ones that belong to the currently authenticated user via the Pipeline class, which has a UserId field. Unfortunately it only returns 1 record.
I added "print()" statements from top to bottom in the aforementioned code. Everything appeared correct down to "features", which showed only the 11 features connected to the authenticated user and not the 1 feature which belonged to another user. But then the last statement just doesn't function correctly, returning only one record.
Any ideas what I might be doing wrong?
Robert
/r/django
https://redd.it/6anhyn
I'm relatively new to Django but generally have figured out how to use filtering quite effectively. However, I have encountered a situation that I can't resolve:
class FeatureStatsViewSet(ModelViewSet):
queryset = FeatureStats.objects.all()
serializer_class = FeatureStatsSerializer
permission_classes = (permissions.IsAuthenticated,)
# TODO: Not sure why this is only returning one record during testing!
def get_queryset(self):
user = self.request.user
pipelines = Pipeline.objects.filter(createdBy=user.id)
features = Feature.objects.filter(pipeline=pipelines)
return FeatureStats.objects.filter(feature=features)
#return FeatureStats.objects.all()
What this code is supposed to do is return 'FeatureStats' for the currently authenticated user. My approach has worked correctly for lots of other tables but not for this one.
"FeatureStats.objects.all()" returns all 10 records in my test data, which is correct.
"FeatureStats.objects.filter(feature=features)" is supposed to return 9 records, which are the ones that belong to the currently authenticated user via the Pipeline class, which has a UserId field. Unfortunately it only returns 1 record.
I added "print()" statements from top to bottom in the aforementioned code. Everything appeared correct down to "features", which showed only the 11 features connected to the authenticated user and not the 1 feature which belonged to another user. But then the last statement just doesn't function correctly, returning only one record.
Any ideas what I might be doing wrong?
Robert
/r/django
https://redd.it/6anhyn
reddit
Trouble getting Filtering working with ViewSet • r/django
I'm relatively new to Django but generally have figured out how to use filtering quite effectively. However, I have encountered a situation that...
Can anyone suggest a website where I can hire someone to teach me how to program in python?
I understand there are many places to learn it for free online. I don't have time to fumble around with it.
I would like to learn it quickly and with less frustration.
Does anyone know where I can find a one on one teacher?
/r/Python
https://redd.it/6ap53k
I understand there are many places to learn it for free online. I don't have time to fumble around with it.
I would like to learn it quickly and with less frustration.
Does anyone know where I can find a one on one teacher?
/r/Python
https://redd.it/6ap53k
reddit
Can anyone suggest a website where I can hire someone... • r/Python
I understand there are many places to learn it for free online. I don't have time to fumble around with it. I would like to learn it quickly and...
Python accumulators
What is an accumulator? Should it be assigned any particular value? Why and why not?
/r/Python
https://redd.it/6aoy4z
What is an accumulator? Should it be assigned any particular value? Why and why not?
/r/Python
https://redd.it/6aoy4z
reddit
Python accumulators • r/Python
What is an accumulator? Should it be assigned any particular value? Why and why not?