« first day (2326 days earlier)      last day (2616 days later) » 

9:01 PM
@MooingRawr in my case it allows me to easily add a custom paginate() function to my queries and some utils such as assign_id() which gets an ID from the DB before flushing the row itself to all models
 
@ThiefMaster just make sure you inherit from flask_sqlalchemy.Model still, the new tablename handling requires it.
 
@davidism that's the whole point of me doing the monkeypatching atm - so i can inherit from db.Model
(and I don't use tablename generation, i'd actually like an option to disable it and thus fail instead of generating a table name if none is specified)
actually, that sounds like a good candidate for a PR...
 
subclass, not inherit, the problem is that now the metaclass pops tablenames so that the autogeneration still works for further subclasses
I wish I could have found a better solution than that.
But yeah, a "disable name generation" patch would be good.
 
im so confused
 
"subclass, not inherit" - uh? that's pretty much the same, no?
 
9:08 PM
@Jfach I'd have to see the traceback and a minimal example
@ThiefMaster yeah, I'm just all over the place. As in class MyBaseModel(flask_sqlalchemy.Model), then passing MyBaseModel to the extension.
please use dpaste.com, or something like it, to past large blocks of code
 
Yeah alright, ill just write up a question on SO then
sorry about that.
 
It's fine here, we just don't like large blocks of code.
 
alright, heres the traceback. I'll try to make a minimal example, just need to do some scrubbing
 
especially not unformatted ones ;)
did you call db.init_app(app)?
 
not that I'm aware of, no.
I call SQLAlchemy(app)
 
9:15 PM
ok, that's the same
(it calls init_app internally)
@davidism: return g.get('sqlalchemy_queries', ()) - is this really a good place to store this?
I wouldn't expect an extension to store data in g but rather directly on the app context - g is meant for application data, so clearing the data from g shouldn't mess with an extension
 
@ThiefMaster hmm, I don't really consider extension data different from application data. When is g getting cleared that wouldn't be acceptable for clearing the query data too?
 
Not automatically, just saying an app could clear it for some reason.
> <ThiefMaster> mitsuhiko: what's your opinion on extensions storing data on `g`?
> <mitsuhiko> i don't know. i'm conflicted
> <mitsuhiko> i kinda want them to put data onto the app context directly i think
 
9:32 PM
To be fair, it's a lot nicer to use g than to mess with _app_context_stack.top, but I can change it back.
 
since you already provide an API to get the logged queries it feels cleaner not to have it in g - that way the application can put whatever it wants there without collisions with data added by an extension
 
Guess I should go change Flask-WTF back too. :-)
Although getting the csrf token in the applicaiton code is probably more common there.
 
a csrf_token proxy might be a good option for that
And hrm, disabling the table name generation with a setting is actually quite tricky
 
I never realized how many people didn't use the autogeneration.
 
I know what a minimal example is.....this is not a minimal problem so it required a pretty long question...I solved it tho — theprowler 17 mins ago
 
9:42 PM
@davidism IMO it's a bit messy once you start using FKs that use string table names
being able to search for the table name and find the model is quite useful
 
Meanwhile, I have large apps built with only autogenerated names. :-/
 
10:01 PM
Never let the client write their own rules on how a certain section of the program should be run. My god the spaghetti code is real...
 
@davidism github.com/mitsuhiko/flask-sqlalchemy/pull/476 - might want to cherrypick 15cfad1, it's kind of unrelated but didn't want to open a separate PR for it
 
 
1 hour later…
11:03 PM
happy 2007/02/27
 
I can't help but feel like that's off by a bit
 
wrong base?
 
whoops. 2017
it's not been a long day at all
@MooingRawr That sounds terrible.
 
11:41 PM
cbg
 
@AndrasDeak finally! The picture works! :D
Oh what
 
it's fine here
you went down the wrong end of an "at most 24 hours between cache reloads"
Undo noted somewhere on meta that the script that refreshes chat profiles/avatars runs at least once in 24 hours
 
Not too bad then
I forgot i was here last night, got an email with your message instead. I like that feature!
 
I think you can set it in your profile
I'm always slacking off around somewhere here, so I rarely get to use it:D
 
Haha, i'm only here when i give up writing some useless app
 
DSM
11:57 PM
Hey, I see oranges! Not grey bars, but oranges!
 
It wasn't easy, I'll tell you that
Orange had to be put through all sorts of trials and tribulations, such as saving their profile after selecting the new avatar
 
DSM
Poor Orange. :-( But all's well that ends well!
 

« first day (2326 days earlier)      last day (2616 days later) »