Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/08/2015, 20:17
MiguelVaras
 
Fecha de Ingreso: agosto-2015
Mensajes: 4
Antigüedad: 8 años, 9 meses
Puntos: 0
Respuesta: [Django]Usar múltiples BD y crearlos con los modelos

holas me apareció el siguiente error

Código:
OperationalError at /adminplus/prueba/conductor/
no such table: prueba_conductor
Request Method:	GET
Request URL:	http://127.0.0.1:8000/adminplus/prueba/conductor/
Django Version:	1.8.3
Exception Type:	OperationalError
Exception Value:	
no such table: prueba_conductor
Exception Location:	C:\Python34\lib\site-packages\django-1.8.3-py3.4.egg\django\db\backends\sqlite3\base.py in execute, line 318
Python Executable:	C:\Python34\python.exe
Python Version:	3.4.3
mi admin.py en "prueba"
Código:
from django.contrib import admin
from prueba.models import *
# Register your models here.
admin.site.register(Ruta)
admin.site.register(Conductor)
mi models.py de prueba
Código:
from django.db import models
from django.db import connections
cursor = connections['prueba'].cursor()

# Create your models here.
class Ruta(models.Model):
	origen = models.CharField(max_length=140)
	destino = models.CharField(max_length=140)
	via = models.CharField(max_length=140)
	
class Conductor(models.Model):
	nro_licencia = models.CharField(max_length=140)
	nombre = models.CharField(max_length=140)
	apellido_pat = models.CharField(max_length=140)
	apellido_mat = models.CharField(max_length=140)
la base de datos:


el admin

rutas funciona bn en las 2 bases de datos :(

lo solucione, pero haciendo un python manage.py syndb , me salta una duda, deberé hacer esto con cada modelo que agregue a las aplicaciones?? perderé algún dato al hacer esto???

saludos