Skip to content

For Users

yongxinxu edited this page Jul 31, 2018 · 10 revisions

This is a documentation for users who use this app to edit the project's database.

Keywords (Control/Command + F):

  • get started
  • import CSV files
  • sample format of CSV files
  • steps for importing NCUA

Get started

Go to localhost/admin, and you will need username and password to log in. Ask us to create an account for you if you do not have one.

After login, you will see the homepage of our admin interface similar to this:

Now you are good to go!

Import CSV files

You are allowed to import CSV files to the following models so far:

  • Contacts
  • Locations
  • Locations(NCUA)
  • NCUA
  • NCUA (edit)
  • Organizations

After you click each model, you will see a page similar to this, and clicking the IMPORT button on the upper-right corner takes you to the import interface:

The importer has a strict requirement for the formatting of the importing file's headers; usually, they should be named exactly as the fields indicate:

Here are the sample formats for some models (all saved as CSV):


Locations & Locations(NCUA)

NCUA

NCUA(edit)


After choosing the file and picking the right format, clicking SUBMIT will lead you to the preview page (Notes: even though there are a few options for the format, CSV is working best for our importer. And we suggest try not to use Microsoft Excel to convert CSV format, because sometimes it gets some small error when doing the conversion):

The preview page looks like this, and the first column of the table indicates the status (new, update, skipped, or delete) of each importing row:

For Locations & Locations(NCUA) models, rows are skipped when their information is already in the database and do not have any difference than the database except for the last column geographic_location. And you might find out that the in your CSV file you do not have any values for this column, but on the preview, you get something like "SRID=4326;POINT (-75.305656 40.0093478)".

It is because our importer extracts the address information of each row when you import the CSV file, and generates the geographic coordinates like this to display the locations on the map. Because we are charged every time when we produce a new geographic pair, as long as other information does not change, we skip the row from our geocoding process. So don't get nervous when you see a red highlight when the status is skipped. You are fine!

And Locations(NCUA) has a special preview interface looks like this, and clicking the Delete button allows you to check the objects that will be deleted:

Other important notes: all changes will be made only when you click the button CONFIRM IMPORT. Don't worry if you do something wrong before it.

After you click CONFIRM IMPORT, you will see a success message in green!

Open one of the objects you just import, you will see all information are there, and for Locations and Locations(NCUA), you see a point on the map corresponding to the address.

Steps for importing NCUA

You might noice that there are three models related to NCUA, it is because NCUA is a special case of Locations; it is operated almost same as the locations of other types, but it needs to have old data, which are not in the spreadsheet you import, delete from Locations database.

Here is the information of these three models:

Model Information
Locations(NCUA) displays all locations of NCUA and is a proxy model of Locations; they share one database, so whatever changes you make from Locations(NCUA) interface are changing the database of Locations.
NCUA includes all oids of the NCUA you recently imported. It provides a reference for proxy model to filter all locations that are of NCUA. It has no direct relationship with Locations database.
NCUA(edit) works for editing NCUA spreadsheet. Usually, the raw data does not have the oid for each location. This model helps you fill the oids automatically if the locations are already in the database.

Here are the steps for importing NCUA:

  1. When you get the raw data of NCUA, organize them into the exact format as we have introduced above (let's call this spreadsheet as "spreadsheet A").
  2. Open NCUA(edit) and import the spreadsheet A. If the location is already in the database, its oid will be auto-filled; otherwise, it is still blank and left to you to check and assign.
  3. After every location gets an oid, click EXPORT button.
  4. Select format (usually CSV) and click SUBMIT, and a new spreadsheet ("spreadsheet B") is downloaded to your computer.
  5. Open Locations(NCUA) and import spreadsheet B.
  6. Edit spreadsheet B by copying the whole column of oid and saving it as a new spreadsheet ("spreadsheet C").
  7. Open NCUA, click a random checkbox ahead of one row, and select the action Delete all NCUA and click Go to delete all the old NCUA data. After the table is clean, import spreadsheet C.

You are done! The order that NCUA(edit) -> Locations(NCUA) -> NCUA should be strictly followed; otherwise, some data can be mis-deleted from Locations database, or not all newly-updated NCUA will show on the Locations(NCUA).

Thanks for your hard work!