GithubHelp home page GithubHelp logo

goodel's People

Contributors

7imon7ays avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

goodel's Issues

Associations

Would be pretty cool for models to have association methods across tables. Add primary keys and use a VLOOKUP for the join.

Styling methods

  • Model#archive => gives row a strikethrough
  • Model#restore() => removes strikethrough
  • Model#isArchived() => boolean
  • Model#emphasize() => makes row bold
  • Model.setColor("color")
  • Model.setBackgroundColor("color")

etc.

Model#destroy & Model#update

Should be able to call model.update({ foo: "bar", baz: null }) and model.destroy(). Both require models to track what row they're in.

To reproduce the behavior of a regular spreadsheet, Model#destroy should remove the entire row. This has the side-effect of changing the row number of every record with a greater row number.

Possible solutions:

  1. Mark deleted record's row as "archived" instead of removing it. Bad: Sheet eventually becomes filled with junk**. Poor usability and performance.
  2. Require a separate, unique, non-null column in every sheet to identify records after rows have been deleted. Bad: Too big a requirement from the user.
  3. Keep every instantiated record in an array, sorted by row number. When a record is deleted, update the row number of all instantiated records that had a greater row number. Bad: Deletion becomes Log(n) + n / 2 operation. Log(n) at worst to find the first instance with a greater row number in the sorted array + n/2 on average to update those rows. Race condition if the user manually changes the sheet while Goodel is running.

Option 3 looks best.

** Not a bad idea to have an "archive" instance method. Opened #8.

Faster querying through JSON feed?

https://spreadsheets.google.com/feeds/list/SHEET_ID/od6/public/full?alt=json returns a JSON string of a spreadsheet if the sheet is published. Relevant paths seems to be

root["feed"]["entry"][i]["title"]

and

root["feed"]["entry"][i]["content"]

Where i is the record's row index. The title key points to the value in row i, column A, content maps the names of the columns to the right of A with the corresponding cells in row i, under the format

"column_i_name: cell_i_value, column_i+1_name: cell_i+1_value"

Probably faster for read operations. Doesn't allow write operations.

Hooks

  • before_validation
  • after_validation
  • before_create
  • after_create
  • after_find
  • after_initialize
  • before_update
  • after_update
  • before_destroy
  • after_destroy

etc.

Take optional origin cell

Right now Godel expects the table to extend from cell A1. It should take take optional cell coordinates so that the user can set his/her table anywhere in the sheet.

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.