GithubHelp home page GithubHelp logo

legacyhalos-web's People

Contributors

aronca avatar dstndstn avatar lc19vill avatar moustakas avatar

Watchers

 avatar  avatar  avatar

legacyhalos-web's Issues

Default form values stopped working

Form values in list.html stopped appearing as default value, and disappear when user clicks search, instead of remaining in search box. This functionality worked before pagination was added.

<td><input id="id" name="mem_match_id" type="number" value="{{ filter.form.mem_match_id.value}}"/></td>
</tr>
<p></p>
<tr>
<th><label for="ralo">RA low:</label></th>
<td><input id="ralo" name="ra__gt" step="0.01" type="number" value="{{ filter.form.ra__gt.value|default_if_none:'100'}}"/></td>
</tr>
<tr>
<th><label for="rahi">RA high:</label></th>
<td><input id="rahi" name="ra__lt" step="0.01" type="number" value="{{ filter.form.ra__lt.value|default_if_none:'200'}}"/></td>
</tr>
<p></p>
<tr>
<th><label for="declo">Dec low:</label></th>
<td><input id="declo" name="dec__gt" step="0.01" type="number" value="{{ filter.form.dec__gt.value|default_if_none:'0' }}"/></td>
</tr>
<tr>
<th><label for="dechi">Dec high:</label></th>
<td><input id="dechi" name="dec__lt" step="0.01" type="number" value="{{ filter.form.dec__lt.value|default_if_none:'10' }}"/></td>

Add Downloadable Search Results feature

Add functionality for user to have option to download their search result.
May wish to download as .fits file like UnWise site. Give option to do so instead of loading table to browser.

Efficiency, where to store session

Currently in order to store the search results to a session, we serialize our queryset of objects using JSON then store to a session variable, which we configured to use the database, over cache or other options.
Setting session variable:

req.session['results_list'] = serialize('json', cen_filtered, cls=LazyEncoder)

Serializing:

class LazyEncoder(DjangoJSONEncoder):
def default(self, obj):
if instance(obj, Centrals):
return str(obj)
return super().default(obj)

Loading from session variable:

cen_list = json.loads(req.session['results_list'])

Is this an efficient way to remember our query result to use it on individual central galaxy pages, in order to link to previous and next galaxy pages?
Is it better to store the session to cache, or to the database like we are currently?
Will this approach scale up once we have a larger data set?

Use uniform data model throughout application

load.py and models.py should both use same data model instead of both explicitly stating the fields to be stored.
In addition, model fields are using different names than the more readable names the user sees on the list.html table

Sort on different properties

Add option to sort by different properties shown in table, from filter page.
Currently Sorting done by redMapperID only.

Make centrals page urls use mem_match_id for directly linking to page

Add functionality to site for a user to directly link to a centrals page without going through filter, using mem_match_id in url.
Currently using index of found result as the url parameter instead of id because of how we slice queryset from session.

def centrals(req):
index = int(req.GET.get('index'))
cen_list = pickle.loads(req.session['results_list'])
cen = cen_list[index-1:index][0]
prev_index = index - 1
if (prev_index == 0):
prev_index = len(cen_list)
next_index = index + 1
if (next_index > len(cen_list)):
next_index = 1
return render(req, 'centrals.html', {'cen_list': cen_list, 'index': index, 'cen': cen, 'next_index': next_index, 'prev_index': prev_index})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.