Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "sqlalchemy"
-
My tech stack progression:
Started with PHP without any frameworks, using a homegrown MVC architecture. Used to use `mysql_` functions everywhere. And only jquery + vanilla CSS in the front end.
Then moved to use PDO functions in PHP and Backbone.js + Less CSS in the front-end.
Then moved to Django in the back-end. Did not like Django very much as it is too opinionated and not flexible (although it's damn good for rapid development if you buy into their type of things).
Then moved to Flask + SQLAlchemy and using a home grown architecture. This is a sweet spot for me in terms of back end and stayed in this spot for the longest time.
Moved to Postgres from MySQL as I fell in love with Postgres.
Then learnt React+Redux. Liked it. Made most sense to front-end development this way. Moved front-end stack to React+Redux.
Learning Haskell and been working with Scotty and eyeing Servant for a while now.
Let's see where it goes from here.
PS: this is my personal journey through various tech stacks in various products at various companies I have worked. I'm not talking about moving a product through these many tech stacks. That doesn't make any sense.9 -
Fuck this I need to ventilate.
Thinking about job change because maintaining and extending 3 years old codebase (flask project) is FUCKIN exhausting. It was badly written since start by someone who obviously didn't know much about python. (Going by commit history.)
Examples:
- if var != None / if var == None
- if var is not None / if var is None (well..)
- Returning self-parsed obscure JSONs from dict variable
- Serializing dictionaries into database by str() (both sqlalchemy and mysql support JSON format) - THEY ARE ALMOST UNUSABLE OTHER WAY AROUND (luckily, python can deal even with that)
- celery tasks, the way they are called they BLOCK the whole flask (not bad in itself, but if connection breaks there are no errors, nothing it just hangs)
- obscure generator/yielding that contains return of flask's response in itself
- creating fifteen thousands of variables one by one where they would look so nicely as dict keys, and hey they are then both MANUALLY SERIALIZED into returning dict by "%s" (string formatting) [okey, some of them are objecst like datetime but MATE WTF]
- many, many more, PEP lint shall not pass
I would rather deal with fresh startup owners wanting me to program unicorns in one week then trying to extend and manage zombie-like projects.
Nothing personal against the firm I actually like the place.3 -
I fucking HATE ORMs. Fuck this bullshit, they always have some use case that is stupidly difficult or obscure that no one knows how to deal with because the creators didn't think of the one thing I want to fucking do.
Screw this bullshit, homebrew SQL is ALWAYS the way to go; I've never encountered an ORM that didn't turn in to a troubleshooting, dialect-learning timesink.5 -
Should i be posting on devRant to hire a fellow devRanter for a project in my company? (temporarily but may become constant if we click well)
More info:
Looking to hire a mostly frontend react dev.
The project is about graph visualisation and traversal.
Our stack is python (flask, appbuilder, SQLalchemy), react, react d3-graph, jest.
Must know how to use git and pull-requests.
(The software is based on Apache superset)
The code is a bit of a mess. But let's be honest, which big project isn't?12 -
Just finished importing over 70,000 rows with a bunch of joins onto a data warehouse for billing purposes. all done thanks to SQL alchemy and python. I feel like a boss.2
-
I have done a fucking awful thing and its that I started a project and I'm using Flask and SQLAlchemy but the part I'm stuck on is something Ive never done in regular SQL, so I cant even communicate what I want to do properly.
Time to binge some SQL real quick. -
!python/ORM
Someone got quality tutorial/blog about Sqlalchemy ?
Even tho I am dealing with py+flask+sqlalchemy last 3 years I am still able to get super confused about contexts/syntaxes.
(Model.query vs session.query(Model), etc.)
😪3 -
PHP: Laravel, Phalcon, Composer
JavaScript: Node.js, Express.js, Restify, Sequelize, AngularJS, React, npm, bower
Python: Django, Flask, Requests, pip, SQLAlchemy
Java: Spring, Dropwizard, Hibernate
DB: MySQL, MariaDB, PostgreSQL, Cassandra1 -
I'm working on my own smarthome project (how rare nowdays...:) ). I'm using microsoft's git repo. I'm not make my project open source, not because I'm a douchebag, but because I'm a very bad coder. My biggest fear is not the fact, that it would be commented as wtf is this code, but receiving pull requests from pros and I wouldn't even understand their code.
This is my "training" project (python, flask, apscheduler, sqlalchemy, bootstrap2, mqtt, micropython)
I'm thinking to make it public without accepting external pulls, just for me to learn more.
I'm just wondering your thoughts on this.
Thoughts?1 -
In Python my favs are lxml and sqlalchemy. Very simple to use and solve the problem of xml and database very easily.
In C++ my fav is the Qt system of libraries. Very nice solutions for structuring an application, cross platform, good memory management, COW if you want it, etc. Every release gets better and better. Oh and boost should get an honorable mention. I really like the ranges library and some of the more esoteric libs it provides.2 -
I starting developing my skills to a pro level from 1 year and half from now. My skillset is focused on Backend Development + Data Science(Specially Deep Learning), some sort of Machine Learning Engineer. I fill my github with personal projects the last 5 months, and im currently working on a very exciting project that involves all of my skills, its about Developing and deploy a Deep Learning Model for Image Deblurring.
I started to look for work two months to now. I applied to dozens of jobs at startups, no response. I changed my strategy a bit, focusing on early stage startups that dont have infinite money for pay all that senior devs, nothing, not even that startups wish to have me in their teams. I even applied to 2 or 3 and claim to do the job for little payment, arguing im not going for money but experience, nothing. I never got a reply back, not an interview, the few that reach back(like 3, from 3 or 4 dozen of startups), was just for say their are not interested on me.
This is frustrating, what i do on my days is just push forward my personal projects without rest. I will be broke in a few months from now if i dont get a job, im still young, i have 21 years, but i dont have economic support from parents anymore(they are already broke). Truly dont know what to do. Currently my brother is helping me with the money, but he will broke in few months as i say.
The worst of all this case is that i feel capable of get things done, i have skills and i trust in myself. This is not about me having doubts about my skills, but about startups that dont care, they are not interested in me, and the other worst thing is that my profile is in high demand, at least on startups, they always seek for backend devs with Machine Learning knowledge. Im nothing for them, i only want to land that first job, but seems to be impossible.
For add to this situation, im from south america, Venezuela, and im only able to get a remote job, because in my country basically has no Tech Industry, just Agencies everywhere underpaying devs, that as extent, dont care about my profile too!!! this is ridiculous, not even that almost dead Agencies that contract devs for very little payment in my country are interested in me! As extra, my economic situation dont allows me to reallocate, i simple cant afford that. planning to do it, but after land some job for a few months. Anyways coronavirus seems to finally set remote work as the default, maybe this is not a huge factor right now.
I try to find job as freelancer, i check the freelancer sites(Freelancer, Guru and so on) every week more or less, but at least from what i see, there is no Backend-Only gigs for Python Devs, They always ask for Fullstack developers, and Machine Learning gigs i dont even mention them.
Maybe im missing something obvious, but feel incredible that someone that has skills is not capable of land even a freelancer job. Maybe im blind, or maybe im asking too much(I feel the latter is not the case). Or maybe im overestimating my self? i think around that time to time, but is not possible, i have knowledge of Rest/GraphQL APIs Development using frameworks like Flask or DJango(But i like Flask more than DJango, i feel awesome with its microframework approach). Familiarized with containerization and Docker. I can mention knowledge about SQL and DBs(PostgreSQL), ORMs(SQLAlchemy), Open Auth, CI/CD, Unit Testing, Git, Soft DevOps Skills, Design Patterns like MVC or MTV, Serverless Environments, Deep Learning Solutions, end to end: Data Gathering, Preprocessing, Data Analysis, Model Architecture Design, Training and Finetunning. Im familiarized with SotA techniques widely used now days, GANs, Transformers, Residual Networks, U-Nets, Sequence Data, Image Data or high Dimensional Data, Data Augmentation, Regularization, Dropout, All kind of loss functions and Non Linear functions. My toolset is based around Python, with Tensorflow as the main framework, supported by other libraries like pandas, numpy and other Data Science oriented utils.
I know lot of stuff, is not that enough for get a Junior Level underpaid job? truly dont get it, what is required for get a job? not even enough for get an interview?
I have some dev friends and everyone seems to be able to land jobs, why im not landing even an interview?
I will keep pushing my Dev career, is that or starve to death. But i will love to read your suggestions! how i can approach this?
i will leave here my relevant social presence:
https://linkedin.com/in/...
https://github.com/ElPapi42
Thanks in advance!9 -
SQLAlchemy is such a bloated piece of crap. Even without the fact that many consider ORMs an anti-pattern, this library is extremely janky, salty and uncomfortable to work with.7
-
Felt like an idiot when realized that argument `back_populate` refers to the attribute of the class passed to `relationship`, not the stupid name of the table of any class, ugh
-
I can't count likes form my database for an specific post. I made a function that will count all the like by "post.id". It shows the like on the web page when I clicked on like button and it disappears when I refresh the browser. but likes are still remaining in the database but it won't appear on the webpage.
Here are the flask code:
def like_count(post_id):
if request.form.get('like') != None:
if (Like.query.filter_by(post_id=post_id).all())==[]:
return 0
else:
return Like.query.filter_by(post_id=post_id).count()
else:
return 0
def dislike_count(post_id):
if request.form.get('dislike') != None:
if (Dislike.query.filter_by(post_id=post_id).all())==[]:
return 0
else:
return Dislike.query.filter_by(post_id=post_id).count()
else:
return 0
Here are the html code:
<!--dislike-->
<form method="POST" action="">
<input name="dislike" value="1" class="input-style" >
<input value="{{post.id}}" name="post_id" class="input-style">
<button class="fas fa-thumbs-down" class="like-button" >
<div class="like-count" >
{{dislike_count(post.id)}}
</div>
</button>
</form>
<!--like-->
<form method="POST" action="" >
<input name="like" value="1" class="input-style" >
<input name="post_id" value="{{post.id}}" class="input-style" >
<button class="fas fa-thumbs-up" class="like-button" >
<div class="like-count" >
{{like_count(post.id)}}
</div>
</button>
</form>8 -
I'm working on a simple Flask project. But when I try to work with the database I got an error called "No module named MySQLdb". I also got error when I try to install "mysql clint" with this command:-pip install mysqlclient. So I searched for the solution of this problem but every time I find someone told to download "MySQL client" from this website:-
https://lfd.uci.edu/~gohlke/...
But the "MySQL client" file is no longer available on that website.
please help me by giving that file or any other way. You can also check my project from here:-
https://drive.google.com/file/d/...
unfortunately, my operating system is Android 6.0
Here is the code:-
from flask import Flask,render_template, request
from flask_sqlalchemy import SQLAlchemy
app= Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://localhost/codingthunder/"
db = SQLAlchemy(app)
class Contacts(db.Model):
sno = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), nullable=False)
phone_num = db.Column(db.String(14), nullable=False)
mes = db.Column(db.String(120), nullable=False)
date = db.Column(db.String(12), nullable=False)
email = db.Column(db.String(20), nullable=False)
@app.route("/home")
def home():
return render_template("index.html")
@app.route("/about")
def about():
return render_template("about.html")
@app.route("/contact", methods=['GET','POST'])
def contact():
if(request.method=='POST'):
name=request.form.get('name')
email=request.form.get('email')
phone=request.form.get('phone')
message=request.form.get('message')
entry=Contacts(name=name,phone_num=phone,mes=message, date="2019-09-01 12:06:20", email=email)
db.session.add(entry)
db.session.commit()
return render_template("contact.html")
@app.route("/post")
def post():
return render_template("post.html")
app.run(debug=True)3 -
Okay so Ive been working on a custom queueing system
basically the system generates ticket numbers for checked in paients and then assigne them to a room when it's their turn to be attended to
so I'm having some challanges with the database when the patient finishes their session with the Dr the admin can remove them from the queue and is supposed to reset the room.state = 0 //which means room in unoccupied
this is proving to be problematic coz it's not even finding the room
😕 😕 😕 😕1