Comments (6)
por algum motivo parece que o model DBF está desvinculado da tabela dbf_dbf. Utilizando o código:
from dbf.models import DBF
DBF.objects.order_by('export_date').last()
me retorna None
Também parece que o migrate que foi executado (com sucesso) porém não alterou a tabela dfb_dbf.
Tens alguma ideia?
from alertadengue.
@xmnlab aqui na minha máquina, rodando com o último dump de dev (2017-03-03_infodengue.sql e 2017-03-03_infodengue.sql) o resultado é:
In [1]: from dbf.models import DBF
In [2]: DBF.objects.order_by('export_date').last()
Out[2]: <DBF: MRJdengon2017-09-01-2017_f2UCmMX.dbf - 2017>
Lembrando que usamos dois bancos (por isso os dev_dumps vem em pares): o dengue
é usado por várias aplicações diferentes (inclusive essa aplicação django) para guardar e recuperar os dados sobre casos, etc. O infodengue
(esse nome é o padrão, mas pode ser modificado se quiser) é um banco que só essa aplicação django usa, que usa o ORM do django. Quando a gente roda DBF.objects.order_by('export_date').last()
é no banco infodengue
que o ORM do django vai buscar os dados.
Por isso, você precisa desse banco carregado. Ou rodando python manage.py migrate
(pra criar as tabelas) e depois importando um DBF (para popular essa tabela) ou importando o dev_dump correspondente (que já tem alguns usuários e alguns dados nessa tabela).
from alertadengue.
Estou tendo problemas também com outras tabelas .. por exemplo, a tabela de usuários do django rsrs
talvez deve ser algum problema de settings .. talvez esteja criando outra base de dados.
vou verificar aqui e te falo.
from alertadengue.
pelo que vi está indo para o geodjango.db
possivelmente por causa da configuração:
'default': config('DATABASE_URL', default='sqlite:///geodjango.db', cast=db_url)
Deve usar mesmo o sqlite? ou teria que usar o postgresql?
from alertadengue.
Foi mal @xmnlab, eu esqueci que a configuração padrão era essa. Aqui na minha máquina eu coloco no arquivo de configurações local (settings.ini
ou .env
) a seguinte linha:
DATABASE_URL=postgres://usuario:senha@localhost:5432/infodengue
Você pode fazer o mesmo, apontar o banco pra um postgres na sua máquina com o dump carregado ou continuar usando o sqlite, rodar as migrações e enviar um dbf (e criar usuários). Fica a seu critério. Pra aplicação django em um ambiente de desenvolvimento faz pouquíssima diferença.
from alertadengue.
@flavioamieiro obrigado! já to rodando pelo postgresql 👍
from alertadengue.
Related Issues (20)
- feat: Remove 'E-Vigilância' component
- Error in docker container wait on CI
- Memcached is not accessible through the external port to release the cache
- Inconsistencies in 2021 notification table data causing duplicates estimated cases HOT 1
- Enhance visibility of 'Technical Reports' link on 'About Us' page
- Error: Null value in total_cases when querying the historico_alerta table
- Deprecated usage of `float` on single element series
- Error: Date for last update in alert pages doesn't display correctly
- Error: 'Connection' object has no attribute 'cursor' HOT 1
- High latency on homepage due to NotificationResume count_cities_by_uf method in the query execution
- Remove cronjob from dockerfile for Django web container to use celery beat
- Fix valueError in data parsing function
- Refactor `load_sinan` command for DBF upload HOT 1
- [State Alert Refactor] Verify aggregations that generate the charts for the states
- [Alert State Refactor] Fix Last Update date in the State page HOT 2
- Improve logging during upload of SINAN table
- Transformar o Site em um PWA
- Date chart and disease chart not displaying correctly after modal close
- [celery] trigger episcanner tasks when SINAN file is uploaded
- [BUGFIX] "config" method is not defined, should be "os.getenv" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alertadengue.