Giter Site home page Giter Site logo

housinghub's People

Contributors

april1029 avatar billyhunt avatar daalmo avatar danharris-asurion avatar dc3po avatar definesfineout avatar dependabot[bot] avatar dgoldstein1 avatar emecas avatar epurpur avatar ericssy avatar jkropko avatar jnoowin avatar julesfll avatar lootzar avatar m-fineout avatar nhrafiq avatar rakshita-kaulgud avatar ramkarri7 avatar thinkharderdev avatar yq-xiong avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

housinghub's Issues

Add Property Form

Form in Navigator Dashboard > Manage Properties for adding new Property

Navigator Dashboard: Left Navigation Component

Left navigation component

See wireframe for UI design

3 Items:

  • Property Managers: View property managers
  • Property Search: Search for properties
  • Manage Properties: Add/edit properties

cannot run app locally on clean install

Migrations not working

(venv) david@david-Oryx-Pro:~/dev/personal/housinghub/backend$ $(cd alembic && alembic upgrade head)
Traceback (most recent call last):
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2285, in _wrap_pool_connect
    return fn()
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 303, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 773, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 238, in _do_get
    return self._create_connection()
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 657, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
    exc_value, with_traceback=exc_tb,
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 652, in __connect
    connection = pool._invoke_creator(self)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 488, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/pgdb.py", line 1653, in connect
    cnx = _connect(dbname, dbhost, dbport, dbopt, dbuser, dbpasswd)
pg.InternalError: could not translate host name "postgres" to address: Name or service not known


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/david/dev/personal/housinghub/backend/venv/bin/alembic", line 11, in <module>
    load_entry_point('alembic==1.4.2', 'console_scripts', 'alembic')()
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/alembic/config.py", line 577, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/alembic/config.py", line 571, in main
    self.run_cmd(cfg, options)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/alembic/config.py", line 551, in run_cmd
    **dict((k, getattr(options, k, None)) for k in kwarg)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/alembic/command.py", line 298, in upgrade
    script.run_env()
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/alembic/script/base.py", line 489, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/alembic/util/compat.py", line 184, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./env.py", line 77, in <module>
    run_migrations_online()
  File "./env.py", line 65, in run_migrations_online
    with connectable.connect() as connection:
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2218, in connect
    return self._connection_cls(self, **kwargs)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 103, in __init__
    else engine.raw_connection()
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2318, in raw_connection
    self.pool.unique_connection, _connection
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2289, in _wrap_pool_connect
    e, dialect, self
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1555, in _handle_dbapi_exception_noconnection
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2285, in _wrap_pool_connect
    return fn()
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 303, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 773, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 238, in _do_get
    return self._create_connection()
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 657, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
    exc_value, with_traceback=exc_tb,
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 652, in __connect
    connection = pool._invoke_creator(self)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 488, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/home/david/dev/personal/housinghub/backend/venv/lib/python3.6/site-packages/pgdb.py", line 1653, in connect
    cnx = _connect(dbname, dbhost, dbport, dbopt, dbuser, dbpasswd)
sqlalchemy.exc.InternalError: (pg.InternalError) could not translate host name "postgres" to address: Name or service not known

(Background on this error at: http://sqlalche.me/e/2j85)

Tests do not work

(venv) david@david-Oryx-Pro:~/dev/personal/housinghub/backend$ coverage run -m pytest
=========================================== test session starts ===========================================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /home/david/dev/personal/housinghub/backend
plugins: cov-2.8.1
collected 3 items / 5 errors                                                                              

================================================= ERRORS ==================================================
_______________________________ ERROR collecting src/auth_handlers_test.py ________________________________
ImportError while importing test module '/home/david/dev/personal/housinghub/backend/src/auth_handlers_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
src/auth_handlers_test.py:2: in <module>
    from server import app, tokenSecret, tokenEncryptAlg
E   ImportError: cannot import name 'tokenSecret'
_____________________________ ERROR collecting src/landlord_handlers_test.py ______________________________
ImportError while importing test module '/home/david/dev/personal/housinghub/backend/src/landlord_handlers_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
src/landlord_handlers_test.py:4: in <module>
    from auth_handlers import encodeJWT
E   ImportError: cannot import name 'encodeJWT'
_____________________________ ERROR collecting src/navigator_handlers_test.py _____________________________
ImportError while importing test module '/home/david/dev/personal/housinghub/backend/src/navigator_handlers_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
src/navigator_handlers_test.py:4: in <module>
    from auth_handlers import encodeJWT
E   ImportError: cannot import name 'encodeJWT'
_____________________________ ERROR collecting src/property_handlers_test.py ______________________________
ImportError while importing test module '/home/david/dev/personal/housinghub/backend/src/property_handlers_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
src/property_handlers_test.py:4: in <module>
    from auth_handlers import encodeJWT
E   ImportError: cannot import name 'encodeJWT'
___________________________________ ERROR collecting src/server_test.py ___________________________________
ImportError while importing test module '/home/david/dev/personal/housinghub/backend/src/server_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
src/server_test.py:3: in <module>
    from auth_handlers import encodeJWT
E   ImportError: cannot import name 'encodeJWT'
========================================= short test summary info =========================================
ERROR src/auth_handlers_test.py
ERROR src/landlord_handlers_test.py
ERROR src/navigator_handlers_test.py
ERROR src/property_handlers_test.py
ERROR src/server_test.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 5 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================ 5 errors in 1.21s =======================================

App does not start up

(venv) david@david-Oryx-Pro:~/dev/personal/housinghub/backend$ serverless wsgi serve
Serverless: Using Python specified in "runtime": python3.6
Unable to import werkzeug (run: pip install werkzeug)
(venv) david@david-Oryx-Pro:~/dev/personal/housinghub/backend$ pip install werkzeug

Wire up top searchbar + sidebar to search properties

The top searchbar should be able to search all text and dropdown fields of all the properties in your database using the search api.

  1. Wire up that searchbar to return results.
  2. A stretchgoal is to add an autocomplete library to the search box.

Property Search API

Search properties by top-level filters:

  • Region
  • Max Rent
  • Bedrooms
  • Bathrooms
  • Date Available
  • Housing Type

Questions about the Property data model

  • Should we require that all properties have a landlord associated with them?
  • Should rent be optional?
  • Are there considerations for different fields being accessed and controlled?
  • Use case for searching rejections based on landlord?
  • What is the best way to ensure that property available information stays up to date?

posgres connection pool is easily overwhelmed

make a bunch of search requests quickly against the API, you will get the error:

housinghub-api_1  | 172.20.0.3 - - [28/Jul/2020 17:13:23] "POST /property/search HTTP/1.1" 500 -
housinghub-api_1  | [2020-07-28 17:13:23,617] ERROR in property_handlers: Unexpected error getting property: $Traceback (most recent call last):
housinghub-api_1  |   File "/usr/housinghub/src/property_handlers.py", line 47, in get_property
housinghub-api_1  |     _property = app.services.property_service().get_property(payload)
housinghub-api_1  |   File "/usr/housinghub/src/services/property.py", line 22, in get_property
housinghub-api_1  |     if (self.db_session.query(Property).all() == None):
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3244, in all
housinghub-api_1  |     return list(self)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3403, in __iter__
housinghub-api_1  |     return self._execute_and_instances(context)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3425, in _execute_and_instances
housinghub-api_1  |     querycontext, self._connection_from_session, close_with_result=True
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3440, in _get_bind_args
housinghub-api_1  |     mapper=self._bind_mapper(), clause=querycontext.statement, **kw
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3418, in _connection_from_session
housinghub-api_1  |     conn = self.session.connection(**kw)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1133, in connection
housinghub-api_1  |     execution_options=execution_options,
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1139, in _connection_for_bind
housinghub-api_1  |     engine, execution_options
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 432, in _connection_for_bind
housinghub-api_1  |     conn = bind._contextual_connect()
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2251, in _contextual_connect
housinghub-api_1  |     self._wrap_pool_connect(self.pool.connect, None),
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2285, in _wrap_pool_connect
housinghub-api_1  |     return fn()
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
housinghub-api_1  |     return _ConnectionFairy._checkout(self)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 773, in _checkout
housinghub-api_1  |     fairy = _ConnectionRecord.checkout(pool)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
housinghub-api_1  |     rec = pool._do_get()
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 131, in _do_get
housinghub-api_1  |     code="3o7r",
housinghub-api_1  | sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30 (Background on this error at: http://sqlalche.me/e/3o7r)
housinghub-api_1  |
housinghub-api_1  | 172.20.0.3 - - [28/Jul/2020 17:13:23] "POST /property/search HTTP/1.1" 500 -
housinghub-api_1  | [2020-07-28 17:13:39,604] ERROR in auth_handlers: Unexpected error registering new user: $Traceback (most recent call last):
housinghub-api_1  |   File "/usr/housinghub/src/auth_handlers.py", line 93, in login
housinghub-api_1  |     payload['username'], payload['password'])
housinghub-api_1  |   File "/usr/housinghub/src/services/auth.py", line 66, in validate_login
housinghub-api_1  |     _user = self.session.query(User).filter(User.username==username).one_or_none()
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3327, in one_or_none
housinghub-api_1  |     ret = list(self)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3403, in __iter__
housinghub-api_1  |     return self._execute_and_instances(context)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3425, in _execute_and_instances
housinghub-api_1  |     querycontext, self._connection_from_session, close_with_result=True
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3440, in _get_bind_args
housinghub-api_1  |     mapper=self._bind_mapper(), clause=querycontext.statement, **kw
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3418, in _connection_from_session
housinghub-api_1  |     conn = self.session.connection(**kw)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1133, in connection
housinghub-api_1  |     execution_options=execution_options,
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1139, in _connection_for_bind
housinghub-api_1  |     engine, execution_options
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 432, in _connection_for_bind
housinghub-api_1  |     conn = bind._contextual_connect()
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2251, in _contextual_connect
housinghub-api_1  |     self._wrap_pool_connect(self.pool.connect, None),
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2285, in _wrap_pool_connect
housinghub-api_1  |     return fn()
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
housinghub-api_1  |     return _ConnectionFairy._checkout(self)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 773, in _checkout
housinghub-api_1  |     fairy = _ConnectionRecord.checkout(pool)
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
housinghub-api_1  |     rec = pool._do_get()
housinghub-api_1  |   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 131, in _do_get
housinghub-api_1  |     code="3o7r",
housinghub-api_1  | sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30 (Background on this error at: http://sqlalche.me/e/3o7r)
housinghub-api_1  |
housinghub-api_1  | 172.20.0.3 - - [28/Jul/2020 17:13:39] "POST /auth/login HTTP/1.1" 500 -

and the backend will be unresponsive

Notes API

  1. Add Notes table to DB
  2. REST API endpoint for adding notes

clean up UX on Main Page

move footer to footer space
copyright right justified
add property right justified

Here is an image of what we are going for.

image

pagination query does not work

request:

curl 'http://localhost:8443/backend/property/search' \
  -H 'Connection: keep-alive' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Authorization: Beaerer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1OTU5NjkxOTQsInVpZCI6Ijg0MmZiYjczLWUzNzctNDkxNC1iZmM3LWI0NDJhM2VlZjViYSIsInJvbGUiOiJuYXZpZ2F0b3IifQ.xlwY0p5-0gUO0-Fhh9POBvNppnSkf4dv_mOg65ARMNM' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Origin: http://localhost:8443' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Referer: http://localhost:8443/home' \
  -H 'Accept-Language: en-US,en;q=0.9,ar;q=0.8' \
  -H 'Cookie: _lfa=eyJiRWx2TzczQXl6R2FaTXFqIjoiTEYxLjEuNzc4NzZkNDNjNzcxNmUxOC4xNTg4Mjc3ODA5MTQ3In0%3D; _ga=GA1.1.1269015900.1588277811; __utma=111872281.1269015900.1588277811.1594146549.1594146549.1; __utmz=111872281.1594146549.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); Tilt-Token=52751d47-dbf6-441d-b1fa-cb4fa00364e1' \
  --data-binary '{"pagination":{"page":0,"results_per_page":15},"searchFields":{}}' \
  --compressed

response:

{
  "pagination": {
    "page": 1, 
    "results_per_page": 42, 
    "totalNumberOfResults": 42
  },
...
}

Property Search Result Table

Data Table Component for Property Search Results

Fields:

  • Housing Type
  • Complex (if available) + Address
  • Rent
  • Bedrooms
  • Bathrooms
  • Property Manager
  • Property Manager contact info
  • Actions
    • Drill down to detailed view

Wire up property form

  • when opening modal, displays data
  • when clicking "save" or "edit" makes request to backend server

nil fields throw error in backend

request:

curl -XPOST \
 "http://localhost:8443/backend/property" \
 -H "content-type: application/json" \
 -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1OTU5NjQzNDMsInVpZCI6Ijg0MmZiYjczLWUzNzctNDkxNC1iZmM3LWI0NDJhM2VlZjViYSIsInJvbGUiOiJuYXZpZ2F0b3IifQ.TCtKenywqBx6E9CbjzJ6Ot69k30Niy431NLRyHDNxik" \
 -d '{"address":"520 East Main Street","allow_criminal_records":true,"application_fee":5000,"background_screening_company":"Cville Background Screening","bathrooms":1,"bedrooms":2,"bus_line":true,"contact_method":["phone"],"credit_screening_company":"Cville Credit Screening","deposit":500,"elevator":false,"floor":3,"has_basement":true,"housing_type":"apartment","is_available":true,"last_month_rent_required":true,"monthly_rent":1000,"potential_month_available":5,"property_name":"Davids Apartment","school_district":"CHS","shared_bathrooms":0,"unit_apt_no":"9","voucher_type_accepted":[],"voucher_type_not_accepted":[],"wheelchair_accessibility":true,"where_listed":["Zillow"],"year_available":2020,"zip_code":"22902"}'

response:

{
  "code": 500,
  "error": "internal error"
}

error:

housinghub-a… │   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1482, in _handle_dbapi_exception
housinghub-a… │     sqlalchemy_exception, with_traceback=exc_info[2], from_=e
housinghub-a… │   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
housinghub-a… │     raise exception
housinghub-a… │   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
housinghub-a… │     cursor, statement, parameters, context
housinghub-a… │   File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 588, in do_execute
housinghub-a… │     cursor.execute(statement, parameters)
housinghub-a… │   File "/usr/local/lib/python3.6/site-packages/pgdb.py", line 1052, in execute
housinghub-a… │     return self.executemany(operation, [parameters])
housinghub-a… │   File "/usr/local/lib/python3.6/site-packages/pgdb.py", line 1077, in executemany
housinghub-a… │     rows = self._src.execute(sql)
housinghub-a… │ sqlalchemy.exc.IntegrityError: (pg.IntegrityError) ERROR:  null value in column "listing_date" violates not-null constraint
housinghub-a… │ DETAIL:  Failing row contains (88bf2c76-059d-4b15-b54b-3947d3500307, null, null, {}, {}, 520 East Main Street, 22902, 9, Davids Apartment, t, CHS, t, f, 1000, {phone}, t, null, null, 5, 2, 1, 0, t, 5000,
500, t, t, null, {Zillow}, 3, apartment, 2020, Cville Credit Screening, Cville Background Screening, null).
housinghub-a… │
housinghub-a… │ [SQL: INSERT INTO property (id, landlord_id, navigator_id, voucher_type_accepted, voucher_type_not_accepted, address, zip_code, unit_apt_no, property_name, bus_line, school_district,
wheelchair_accessibility, elevator, monthly_rent, contact_method, is_available, date_first_available, last_contact_date, potential_month_available, bedrooms, bathrooms, shared_bathrooms, has_basement, application_fee,
deposit, last_month_rent_required, allow_criminal_records, listing_date, where_listed, floor, housing_type, year_available, credit_screening_company, background_screening_company, last_contacted_by) VALUES (%(id)s,
%(landlord_id)s, %(navigator_id)s, %(voucher_type_accepted)s, %(voucher_type_not_accepted)s, %(address)s, %(zip_code)s, %(unit_apt_no)s, %(property_name)s, %(bus_line)s, %(school_district)s, %(wheelchair_accessibility)s,
%(elevator)s, %(monthly_rent)s, %(contact_method)s, %(is_available)s, %(date_first_available)s, %(last_contact_date)s, %(potential_month_available)s, %(bedrooms)s, %(bathrooms)s, %(shared_bathrooms)s, %(has_basement)s,
%(application_fee)s, %(deposit)s, %(last_month_rent_required)s, %(allow_criminal_records)s, %(listing_date)s, %(where_listed)s, %(floor)s, %(housing_type)s, %(year_available)s, %(credit_screening_company)s,
%(background_screening_company)s, %(last_contacted_by)s)]
housinghub-a… │ [parameters: {'id': UUID('88bf2c76-059d-4b15-b54b-3947d3500307'), 'landlord_id': None, 'navigator_id': None, 'voucher_type_accepted': [], 'voucher_type_not_accepted': [], 'address': '520 East Main Street',
 'zip_code': '22902', 'unit_apt_no': '9', 'property_name': 'Davids Apartment', 'bus_line': True, 'school_district': 'CHS', 'wheelchair_accessibility': True, 'elevator': False, 'monthly_rent': 1000, 'contact_method':
['phone'], 'is_available': True, 'date_first_available': None, 'last_contact_date': None, 'potential_month_available': 5, 'bedrooms': 2, 'bathrooms': 1, 'shared_bathrooms': 0, 'has_basement': True, 'application_fee':
5000.0, 'deposit': 500.0, 'last_month_rent_required': True, 'allow_criminal_records': True, 'listing_date': None, 'where_listed': ['Zillow'], 'floor': 3, 'housing_type': 'apartment', 'year_available': 2020,
'credit_screening_company': 'Cville Credit Screening', 'background_screening_company': 'Cville Background Screening', 'last_contacted_by': None}]
housinghub-a… │ (Background on this error at: http://sqlalche.me/e/gkpj)
housinghub-a… │
housinghub-a… │ 172.20.0.3 - - [28/Jul/2020 16:36:36] "POST /property HTTP/1.1" 500 -

Create a cell and row component

Currently the Cell and Row components are created with a map function in the LocalTable component located in Table.js. We would like those components put in separate files, Row.js and Cell.js.

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.