defining table_name dynamically in _meta database not functioning properly
```python
Weathervalue._meta.table_name = self.selectedstation+'_weathervalue'
del Weathervalue._meta.table  # Remove cached table property, will regenerate
```

Can you test making the addition above? Issue resolved. According to the documentation, I needed to create a table model for each table in the database in this case 2 tables even though fields are identical. I added the table name in the table model in the meta field. Based on which one I selected I accessed the corresponding table model. I originally created only one table model for both which didn't worked. 

I noted in the context manager when using the with statement it doesn't properly close the database connection as I was able to verify with the db.is_closed() statement. I needed to add the db.close() to close the connection. Should I create a separate issue for this? > I noted in the context manager when using the with statement it doesn't properly close the database connection as I was able to verify with the db.is_closed() statement. I needed to add the db.close() to close the connection. Should I create a separate issue for this?

This is tested. Probably some issue on your end:

https://github.com/coleifer/peewee/blob/master/tests/database.py#L165-L186 Thanks. It is probably in my code the way I initialized the database. I will look at it again. 
I am trying to define the table_name in the _meta database dynamically in the Python code. When defining the default table to use for a select query it doesn't access the proper table when it has been defined at the start even do the connection to the database was closed. 

Used this command for defining the table_name before opening the database dynamically:

```
Weathervalue._meta.table_name = self.selectedstation+'_weathervalue'
with db:
    year_function=fn.YEAR(Weathervalue.Date_Value)
    year_db=Weathervalue.select(year_function.alias('year')).group_by(year_function)
                   .order_by(year_function)
db.close()
```

It does use the table_name the first time around but it doesn't use it on subsequent calls when the name changes. I tried to define the table_name after opening the database connection but to no avail. It doesn't seem to have any effect after opening at least once. It retains the table_name on subsequent calls to the database. It doesn't reset the table_name to None when closing the database. 
