Giter Club home page Giter Club logo

wcdb's Introduction

cs373-wcdb

wcdb's People

Contributors

eddies5 avatar bblee1002 avatar osaprych avatar pvcarroll avatar shae-wat avatar

Watchers

 avatar Ben Delaware avatar  avatar Shan Gupta avatar  avatar  avatar Elad Liebman avatar

wcdb's Issues

Issue Tracker

Issue Tracker is being created as the issues come up.

minixsv

research & begin to use minixsv

default template

Create a template dir in the project root. Create a default template for the project.

XML Schema/Instance

We decided to use the schema that was posted on Piazza, so hopefully we'll be using the same schema as the rest of the class and wouldn't have to change it.

Import Django to import to Django

Brandon and my python interpretors both failed to import Django

shaelyn@Laptop:~/Soft_Eng/cs373-wcdb$ python
Python 2.7.4 (default, Apr 19 2013, 18:32:33)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> from django.db import models

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/django/db/init.py", line 11, in
if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
File "/usr/local/lib/python2.7/dist-packages/django/conf/init.py", line 53, in getattr
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/init.py", line 46, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

SOLUTION: When you use Django, you have to tell it which settings you’re using. This is done by using an environment variable, DJANGO_SETTINGS_MODULE. You set this environment variable to the path of the settings you wish to use. The following code was inserted to fix the error:

os.environ["DJANGO_SETTINGS_MODULE"] = "cs373_ATeam.settings"

Report

Our report should contain Title, Introduction, Design (XML Schema), Implementation (Import/export facility), Testing.

Fill Django models

Need to write (and name) a file *.py that uses an element tree when parsing xml. This parsed xml stored in the tree is then used to fill Django models with the parsed information.

Before this code is written, we should verify that the xml we wrote is in the format that we want it and that we want to progress at this point (rewriting how the models are filled will be difficult)

Can't test unit tests

We try to run manage.py and we receive the following error:
django.core.exceptions.ImproperlyConfigured: You haven't set the database ENGINE setting yet.

Confidence in Unittests

Right now, if an assert fails within our tests.py unittests, the entire Unittest page from website fails to load and gives a nasty error page. Since this project is focused so much on usability, this would be a fatal error.

Two options:

  1. Have absolute confidence in our submission (why would well-written unit tests fail?)

  2. Handle this case (shit happens)

investigate using db

Hey, we may have to actually use a db for phase 1? It's not clear on the project page, it just says, "load into Django Models." Who knows what that means.
But in a regular web development set up, we'd save our models to the database.
Investigate saving the models to the database.
You'll have to have mysql access or use sqlite3.
Make sure to run "python manage.py syncdb" to create the necessary model tables.

Models are populating twice

For some reason, models are being populated twice over, so every list's elements are duplicated

Solution: Originally the error seemed to be related to lists, as they had the duplicates. However, it was actually related to populate models getting called twice. The reason it was believed that it was more of a list related error is because non-list attributes were correct. There was a simple explanation to this however, since overriding a non-list value with a copy doesn't really show a change, even though it was assigned twice.

Implementation

We'll need to use assert to check pre-conditions, post-conditions, argument validity, return-value validity, and invariants.

Establish unittests with MySQL

shaelyn@Laptop:/Soft_Eng/cs373-wcdb/cs373_ATeam$ vim settings.py
shaelyn@Laptop:
/Soft_Eng/cs373-wcdb/cs373_ATeam$ python manage.py syncdb
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

Where the settings.py holds the following db information
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'cs373_shaelyn', # Or path to database file if using sqlite3.
'USER': 'shaelyn', # Not used with sqlite3.
'PASSWORD': 'SNdHe8EBVv', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}

Modifying Li

Make Li into a model, have it know what crisis, person or organization it belongs to, let it know what kind of Li it is, e.g. location, human impact, etc. Also, add citation numbers,

host

Host the django site on the home directory of your CS account.

Unit Tests

We'll need to create unit tests for our code.

Git Repository

Git Repository was created by Eddie, and he invited the rest of the group as contributors.

Making the pydoc purdy

To effectively comment on our functions and generate a beautiful pydoc, following the following formatting scheme"

def f_to_comment()
...."""
....Description : what, with what, returning what
...."""
....code
....code

where the .... represents an indent on a git issue commnent

Running the team XML

When I copy-pasted the XML from the xmlInstance google doc into a run-able xml file, import into our website failed.

I got the following output error:
TypeError at /import/

cannot concatenate 'str' and 'XsvalError' objects

I have not the slightest clue what this is or where exactly it is coming from (it is triggered from a loadModel.py exception but where in the code). My egypt-related XML code imported and exprted from the website successfully so I am not expecting any errors like this from egypt stuff.

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.