mattmcc: ah, looks I will have to manually in all envs - pip doesn't do uninstall
Forgetful_Lion has quit
mattmcc
Sure it does.
chhantyal
uninstall*
chuckharmston has quit
really? that would be nice, but how?
mattmcc
Although it can't uninstall something that wasn't installed as a package. Are you sure you don't have PIL as a distro package?
pip uninstall foo
oakridge joined the channel
chhantyal
mattmcc: haha thanks, i mean via requirements file
basti-mbp has quit
Forgetful_Lion joined the channel
mattmcc
Oh, yeah, requiring a package to not be present would be kinda odd.
Draconis
ugh
demi joined the channel
johnb25 has quit
Forgetful_Lion has quit
Forgetful_Lion joined the channel
bradfordtoney has quit
calvinx joined the channel
onr
how can i replace the ORM, template engine and URL dispatcher?
twoface1
by not using django :)
it doesn't really make sense to use django, if you are going to replace it all anyway
bkuberek joined the channel
but... replace the orm by not using it - just use sqlalchemy models or whatever - replace the templating engine by doing your own calls to jinja2 (or something else)
the last is not really possible, i think
onr
i like its stuff like Admin, Auth and ecosystem
BakaKuna joined the channel
oh, the least is the ugliest one
ojh has quit
mattmcc
onr: The admin and auth both depend on the template language and ORM.
onr: That doesn't mean _your_ apps have to use it, however.
Nothing stops you from writing Django apps that use SQLAlchemy and Jinja2.
bkuberek has quit
onr
ah, that's horrifying
mattmcc
Of course if you wanted to access anything that the admin was managing from your apps, you'd have to do a lot of duplicate effort.
Forgetful_Lion has quit
What's your motivation for avoiding the ORM?
demi has quit
moneydouble
I don't see why theres anything wrong with the ORM..
onr
i like SQLAlchemy more, mattmcc
i just can;t get used to django orm
moneydouble
onr: well you can use it, if you want..
mattmcc
Well, write your own admin using SQLAlchemy, and you're good (the auth app would be trivial to replace)
ojh joined the channel
Although surely there's, like, a Flask admin or something out there.
onr
hmm
Forgetful_Lion joined the channel
mattmcc
I mean, the admin just isn't a good enough reason to use Django when you don't want to use the rest of it.
MrS1lentcz
i think, if anyone want develop in django, for future working in team is not good idea replacing base libraries with others...
onr
i actually like the ecosystem, solves too many things i'd struggle with Flask
mattmcc
Maybe the ORM isn't as bad as you think..
Qowface has left the channel
fredvd joined the channel
airtonix
what's so good about sqlalchemy?
i've never used it
mattmcc
Heh.
It's a different philosophy.
airtonix
is it an orm?
Xxaxx has left the channel
mattmcc
Not really. It's a nearly complete abstraction of SQL in Python.
Tjati joined the channel
airtonix
so it makes using sql not suck
freeman_u joined the channel
mattmcc
To the extent that that's possible..
MrS1lentcz
i mean writing application with not orm layers is not so effective as with orm :)
mattmcc
Well, it all depends on what you're doing.
rudasn joined the channel
MrS1lentcz
mattmcc: i wrote robust reservation system with django orm without any problems... with querysets only
mattmcc
There are plenty of things I handle in the DB and only expose to Django as DB views, or use raw( 0for
raw(), even
I also do a lot of PG-specific stuff that leverages djorm-expressions, djorm-pgarray, etc.
tiktuk has quit
airtonix
mattmcc: is it a bad idea to design a database schema, populate it, then try to make django work with that ? instead of designing the schema with djangos models.
i feel it would be
Forgetful_Lion has quit
mattmcc
MrS1lentcz: Also, there's a difference between what querysets are capable of and what they're good at.
While they're certainly good at being careful about the SQL they generate being optimized, it's also not difficult to generate some pretty horrible queries if you aren't mindful of how queryset filters/annotations map to SQL.
Forgetful_Lion joined the channel
airtonix: That totally depends on the schema you designed.
airtonix: If it's anywhere within driving distance of normalized, you probably wouldn't have a problem creating models for it after the fact.
There are gotchas, however, such as the requirement that all model tables have a single-field PK.
greg_f joined the channel
airtonix
yeah i really mean in terms of long term planning . it kinda reaks of bandaid development
basti-mbp joined the channel
mattmcc
Well, that depends on your background.. :)
airtonix
lets just say i walked away from that project
so many red flags
mattmcc
Also, a DB that's intended to be consumed by more applications than just Django may not want its schema dictated by Django's expectations.
I know plenty of DBAs that would laugh you out of the room if you suggested that one application gets to tell him how to design his schemas.
airtonix
how would such a thing be testable ?
loltu- joined the channel
wouldn't there always be this unknown aspect to it?
mattmcc
Eh, inspectdb is a decent starting point, but it's far from comprehensive.
It's not good at detecting M2Ms, for example.
onr
mattmcc: i believe you like sqlalchemy too :)
mattmcc
But if you didn't have an individual person who knew enough about SQL and Django to determine if they'd mesh well, then two people (one familiar with the schema and one with Django) would definitely be able to figure it out.
airtonix
mattmcc: lets hope one of them doesn't get hit by a bus
mattmcc
onr: Honestly, I've never used it beyond a few tiny scripts, years ago.
airtonix: Eh. We only need 'em both long enough to make the determination. ;)
airtonix
hah
"what do you mean you can't maintain this"?
Forgetful_Lion has quit
mattmcc
(I'm saying this as a partner in a company that has a bus factor of 1 for almost all of its products)
onr
"Also, a DB that's intended to be consumed by more applications than just Django may not want its schema dictated by Django's expectations.", major selling point of SQLA over Django ORM
mattmcc
onr: I disagree.
olasd_ joined the channel
Wu has quit
Tyklol joined the channel
Ergo joined the channel
onr
mattmcc: do explain
mattmcc
If you were reading the rest of what I was saying, the ORM can easily accomodate plenty of different schemas, provided they're anywhere near a normalized form.
carljm_ joined the channel
Barring the single-field PK issue.
Sembei has quit
airtonix
lets assume this schema was created in a vacum
onr
ORM is only one part of SQLAlchemy, as you know
Forgetful_Lion joined the channel
matt`r_ joined the channel
and i know lots DBAs recommending SQLA for existing schemas
mattmcc
Sure, because DBAs think in SQL terms, and SQLAlchemy is largely about letting you continue to think in SQL terms.
calvinx has quit
And Django's ORM is about thinking in object terms.
oakridge has left the channel
shredding joined the channel
FWIW, there have been several efforts over the last few years to bridge the ORM to SQLAlchemy.
But it's been largely an academic exercise; there doesn't seem to be enough demand behind it for such a thing to produce a workable mechanism.