question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[request] code snippet to retrieve files/data from local database

See original GitHub issue

Hi,

First, thanks a lot for open-sourcing the code and database which I highly appreciate it.

I have recently installed the database locally for faster query of the entries. However, I’ve had a bit of difficulty in retriveing structures from the database, and thought to ask here if it is possible to share a code snippet which would help solving my issue.

As an example, I would like to know if I follow the tutorial for getting the entries based on the composition as:

elts = [ 'Fe', 'Li', 'O' ]
others = Element.objects.exclude(symbol__in=elts)
comps = Composition.objects.exclude(element_set=others)

How can I iterate over the composition and retrive the structures associated with each entry?

Best regards, Pezhman

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pzarabadipcommented, Jul 27, 2021

Thanks a lot @tachyontraveler, much appreciated. Best regards, Pezhman

0reactions
jlaw9commented, Sep 29, 2021

@pzarabadip Did you figure out how to extract the necessary info to reconstruct the structure files from the SQL DB? Could you please post your solution here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fetching data from the server - Learn web development | MDN
This article shows how to start working with Fetch to fetch data from the server.
Read more >
How To Use the JavaScript Fetch API to Get Data - DigitalOcean
In this tutorial, you will create both GET and POST requests using the Fetch API.
Read more >
How to Pull Data from an API using Python Requests
Goes in the URL: Take the URL that outputs from the code snippet and paste it into your browser.
Read more >
How to Fetch Data using API and SQL databases!
Hands-on Code to Fetch data from API. Open your Jupyter Notebook to write the code and extract the data in the dataframe. Install...
Read more >
Python basics - request data from API and write to a file
retrieve data into a variable; write this into a file (later, as I get more familiar with Python, into my local MySQL database)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found