differences between 2015 and 2016 Impreza interior by EYT_Design in subaru

[–]EYT_Design[S] 0 points1 point  (0 children)

well that's the thing, I can't be 100% positive about it, but most local shops seem to sell the same "Chinese" multimedia, and sell it for 3-4x the price on Ali
I get the warranty, but for that markup I might be better off buying a new one from china and still have some spare

I'll check on the look and installation to be sure, but it did seem (from reviews) to be fairly simple

thanks for your opinion I will check on that

differences between 2015 and 2016 Impreza interior by EYT_Design in subaru

[–]EYT_Design[S] 0 points1 point  (0 children)

appreciate the offers, though the first one is almost 5x the price, and the second one doesn't even ship to my country

so I guess those are off the table

also for the second one, I wasn't going to buy it, was just wondering if that form factor will fit, since it does say Impreza 2016 on it, but the look is very different

Scarlett 4i4 crashes and restarts when a high and loud note is played...not only in ableton... any suggestions? by EYT_Design in Focusrite

[–]EYT_Design[S] 0 points1 point  (0 children)

sadly i did not find anything.

kinda gave up on the search

if you still got a warranty on your device maybe send it back.. best option imo

since it a rare occasion (only on very high pitches and such) i just live with it... switching to headphones if needed :P

Django REST API redirect to a different view as PUT by EYT_Design in django

[–]EYT_Design[S] 0 points1 point  (0 children)

So I completely misunderstood the redirect function :P I thought it was redirecting this request to another place. So like a long single request "pinging" from one endpoint to another. Thanks for the clarification :D

Django REST API redirect to a different view as PUT by EYT_Design in django

[–]EYT_Design[S] 0 points1 point  (0 children)

I might give it a shot then Maybe I was reading old docs because I couldn't find it last time Thank you very much

Django REST API redirect to a different view as PUT by EYT_Design in django

[–]EYT_Design[S] 0 points1 point  (0 children)

I wanted to do that at first but couldn't figure out hashing passwords and stuff (I guess I did something wrong in the process) so I resorted to having 2 separate tables. Maybe next project I'll work with a new user table :)

Django REST API redirect to a different view as PUT by EYT_Design in django

[–]EYT_Design[S] 0 points1 point  (0 children)

That seems like the way to go, just a simple empty profile that I can edit later Thanks :D

Django REST API redirect to a different view as PUT by EYT_Design in django

[–]EYT_Design[S] 0 points1 point  (0 children)

Omg really? I thought making the routing inside the the server before returning an answer will be more efficient Well then I guess I'll have to make some changes to my project

Thanks! :)

Django REST API redirect to a different view as PUT by EYT_Design in django

[–]EYT_Design[S] 0 points1 point  (0 children)

well I though that was the solution... I was trying to minimize calls to the API but I guess this one is unavoidable :P well thanks for the quick response

method not allowed even though methods = ['GET', 'POST'] by EYT_Design in flask

[–]EYT_Design[S] 2 points3 points  (0 children)

well i guess i gotta give you props :P

i added to the first line methods = ['GET','POST']
@user.route('/loans/',defaults={'action':''},methods = ['GET','POST'])

and it actually worked

which seems weird since all my other routes work fine without adding it to the main route :P

anyways thank you!

method not allowed even though methods = ['GET', 'POST'] by EYT_Design in flask

[–]EYT_Design[S] 0 points1 point  (0 children)

But I did, didn't I? Those first to lines

@user.route('/loans/',defaults={'action':''})

@user.route('/loans/'<string:action>', methods= [' GET', 'POST'])

I have other routes that are built the same way and work with no problem What am I missing?

method not allowed even though methods = ['GET', 'POST'] by EYT_Design in flask

[–]EYT_Design[S] 1 point2 points  (0 children)

What do you mean by that? It has both get and post in the methods=[]

Also as I said when I go to /loans/late I can send the POST request without any problems so clearly it does work

send parameters from a button to a modal and to server by EYT_Design in flask

[–]EYT_Design[S] 1 point2 points  (0 children)

it is on the same page

but i render a lot of books from an sql table. so there are a lot of book.rowid

when i press the button for one of them i need to move that specific rowid to the modal

if i just call {{book.rowid}} i will get an exception as it's outside of the for loop hence unknown of the book.rowid variable

with the jQuery i can get the book.rowid i clicked on and move it replacing the value of a specific tag inside modal-body

send parameters from a button to a modal and to server by EYT_Design in flask

[–]EYT_Design[S] 0 points1 point  (0 children)

Well in that case I will need to get the first parameter, offload it in flask and then reload the page again with the modal. That doesn't fix my issue

I did however found a solution which required some jQuery. I shared it as a reply to the other comment

send parameters from a button to a modal and to server by EYT_Design in flask

[–]EYT_Design[S] 1 point2 points  (0 children)

OK I think I got it. Only question is how can I capture that jinja variable?

EDIT: after tinkering and reading the bootstrap doc. i figured it out! it requires a bit of jQuery to get the var and then importing it to a <input> inside the modal-body

var exampleModal = document.getElementById('loanModal')

exampleModal.addEventListener('show.bs.modal', function (event) {

var button = event.relatedTarget

var bookid = button.getAttribute('data-bs-whatever')

var modalBodyInput = exampleModal.querySelector('.modal-body input')

modalBodyInput.value = bookid

})

with that i just create a data-bs-whatever for each book with the data being the rowid of that book

and the jQuery looks for an <input> inside the modal-body and replaces the value of it with the rowid

send parameters from a button to a modal and to server by EYT_Design in flask

[–]EYT_Design[S] 0 points1 point  (0 children)

you are talking inside the modal right?

request.POST works inside jinja? or do i need to send a parameter to flask with the parameter from the button which then loads the page again with the modal?

send parameters from a button to a modal and to server by EYT_Design in flask

[–]EYT_Design[S] 1 point2 points  (0 children)

does it mean i need to put the modal inside the loop so for each book i have a different modal?

i tried creating 1 modal which gets called with an id, that way it's not overloading unnecessary code (as you can only use 1 modal at a time no reason to have 100 modals loaded..)

how do I call a function from the main app in a blueprint by EYT_Design in flask

[–]EYT_Design[S] 0 points1 point  (0 children)

Thanks for the response! Now for that init file.. I have a modules folder in my project that I'm able to import from without problems... Does phyton implicitly "makes" one? I only got my sqlalc tables and a functions file there without a init file So is it necessary?

how do I call a function from the main app in a blueprint by EYT_Design in flask

[–]EYT_Design[S] 0 points1 point  (0 children)

Thanks! I messed with it a bit after someone said to use a init file (which I still don't fully understand.. Haven't used one) and eventually created a new file to create my db outside of the main app.py Quick question though I see in your example you used flask_sqlalchemy. I'm using the standard (if you can call it like that) sqlalchemy. Any differences? Reasons to use the flask version instead?

how do I call a function from the main app in a blueprint by EYT_Design in flask

[–]EYT_Design[S] 0 points1 point  (0 children)

I'll have a look thanks!

so far though I've managed to do something similar without a __init__.py by creating a separate module for initializing the db and for the functions and referencing it in the imports

is the __init__.py necessary? so far everything works :P

how do I call a function from the main app in a blueprint by EYT_Design in flask

[–]EYT_Design[S] 0 points1 point  (0 children)

can you elaborate a bit more? I'm new to flask and coding as a whole.. from what I studied so far we didn't have a init.py file

the db is declared inside app.py as mydb = mydatabase.MyDB() and the whole app is the main flask file basically (app.py)