« first day (3124 days earlier)      last day (1825 days later) » 

10:00 PM
i'm stumped
maybe someone can help me with this

if

x = {'test1': Table('test1', MetaData(bind=None), Column('id', INTEGER(), table=<test1>, nullable=False, server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object at 0x000001F83BCAEC50>, for_update=False)), Column('name', VARCHAR(), table=<test1>, nullable=False), schema=None), 'test2': Table('test2', MetaData(bind=None), Column('id2', INTEGER(), table=<test2>, nullable=False, server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object at 0x000001F83BCCEA58>, for_update=False)), Column('name2', VARCHAR(length=200
 
@JRick first step: read the error (with traceback)
 
@JRick What on Earth is that?
You're trying to get sections of an SQLAlchemy query?
 
@roganjosh I think it's done. I mean, it works smooth as silk. I got the access token, and it last for 6 hours! Now I can use the API!
 
@roganjosh yes !
 
10:02 PM
@roganjosh it's za001a under a new name and avatar chat.stackoverflow.com/users/10624521/j-rick?tab=recent
 
Ah
 
Also, in Australia, there's the "granny flat", a small self-contained apartment, often built as an extension to an existing house, usually for a widowed grandmother
 
also i have tried X["test1"] and i got output 'test1' , yes a string
 
@PM2Ring That is very specific
 
@JRick why would you want that, though. It's the __repr__ of a query that you wrote so why try parse that?
 
10:04 PM
@roganjosh test1 is a table , i'm trting to get / define it's structure to the system
 
Is fine to save and send through the internet my client secret in plain text... I find it a bit... uncomfortable.
 
I could be wrong, but this feels like it's just gone totally off-course
 
@roganjosh maybe i don't know , i just have a URL of a database that i need to define it's structure and not by app.config
 
@EnderLook True, and sometimes granny flats aren't occupied by grandmothers, or other clise relatives. They may be rented out to strangers. But they're small, and generally not suitable for more than 1 adult occupant.
 
that is what i found online , i could be wrong tho
 
10:07 PM
I think you probably are
This is for connecting the 3rd party DB to your service?
 
the good thing is i can see the column structure their so i'm not that sure
@roganjosh yes!
exactly
 
Right, and I did suggest seeing how SQLAlchemy does it. Did you read that github?
 
@roganjosh i heard about sqlalchemy automap but i'm not sure how to do it , i couldn't find any tutorial that can walk me through it
 
I anticipate the "no". You cannot parse something like what you posted and get something useful here
There is no tutorial (that I know of), but the library is here
 
@roganjosh thanks
 
10:12 PM
You wan the session associated with your app. You can see how they do it. I'm not suggesting it's easy, but don't abandon that to parsing those kind of strings
 
@roganjosh i've not used github before , i'm suppose to click on the links below the app files right ?
 
Try it?
 
i've it already installed
i'm using it
 
No no, you don't need to install anything. that is a link to, more-or-less, what you have installed when you do pip install .... You can browse the code
 
@roganjosh like opening every file and find how the automap works ?
 
10:16 PM
1 sec
 
ok
 
This Is the Cpython source code. If you scan down the list of files, you'll probably recognise names. When you just run Python modules, nothing pip installed, this is the code you're using. You can always go back to the source
Versions change, and line numbers may shift, but github is pretty much the repository to browse for code
In your case, I'm suggesting to look at flask-sqlaclehmy and see how it hooks on to the app
 
bless you
 
o.O that is really not familiar at all
i think maybe look around maybe some one have an example or a tutorial somewhere instead of blowing up my head on this
 
you also have to practice debugging so you don't get stuck on things like "this f-string gives me an error"
 
10:22 PM
check this out , that is the original doc , it says right in the definition
 
So, if you were to do pip install flask-alchemy then this is the functioning code. Not much, and you get it for searching "flask sqlalchemy github"
 
@roganjosh :D
> flask-sqlaclehmy
flask-aqlaclhemy
 
Your job is to go through those files and try to see how it hooks on to a flask app
Yeah, Goole autocorrect is a thing, right? :P
 
@roganjosh i can do that , it's not too hard to go through 4 files rather than like 500 folders
 
@AndrasDeak I missed my edit window :( But I think the point got across
@JRick So, dig in :)
 
10:25 PM
@roganjosh thanks man , i will :)
 
Oh man, my typing has been terrible this evening :/ "Goole" instead of "Google" and various shots at "alchemy". Sorry :/
I'll take more note of the Grammarly adverts that YouTube keeps shoving at me
 
10:43 PM
@roganjosh i might be wrong but i think automap is not included in flask-sqlalchemy
maybe i should switch to sqlALchemy instead of the library
https://github.com/pallets/flask-sqlalchemy/blob/master/flask_sqlalchemy/__init__.py

i checked the init file and googled "map" i couldn't find and function for it
 
Flask-SQLAlchemy is a wrapper
You want a second connection available to you that is shared across the app, no?
 
@roganjosh yea , but does this means all the functions in SQLAlchemy are included in flask- SQLALCHEMY ?
@roganjosh i just want it for a single session
 
So I directed you there to see how they implement it
 
Not that it was a solution. I already linked another library that can deal with multiple connections. IIRC i told you that your solution for linkinging multiple DBs, one specified by the user, was to be found there
 
10:49 PM
here u can see that automap was Added sqlalchemy.ext.automap.
 
The conversation is on divergent paths. I don't think I can be of any help to you anymore
 
oh :/
 
Not in a rude way, but I think you're trying to do something that doesn't align with what I think you're trying to do
 
i'm not gonna blame u if u decided to give up , i know i'm absolutely lost in between all that.
ohh
yea well i just want the user in session to be connected to a second database along with the default ones.
 
If I can't grasp the whole problem then suggesting more is not going to be helpful for you so I should stop
 
10:54 PM
i have a question about this problem can i post it here or in private ?
so u can see the whole issue
 
I think you should post it here, as long as it fits within the room rules. There is no need for a private question, and indeed, the 4am start this morning is making me flag
 
well it's a new question and that's why they ask for 48h at least before posting .
 
flag, as in, getting super-tired giving up btw
 
ohh dude u should drop out
get some sleep for tomorrow
 
rbrb :)
 
11:28 PM
ugg....Django's ModelForm.errors field has HTML tags. But I just want the error message!
 
is it a bad idea to use flask-sqlAlchemy with SqlALchemy ?
i've noticed that part of SQLAlchemy is not included with Flask-SQLAlchemy
"from sqlalchemy.ext.automap import automap_base"
should i just add both like

from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.automap import automap_base
 

« first day (3124 days earlier)      last day (1825 days later) »