Skip to content

Instantly share code, notes, and snippets.

@flaviocdc
Created May 8, 2012 22:57
Show Gist options
  • Save flaviocdc/2640186 to your computer and use it in GitHub Desktop.
Save flaviocdc/2640186 to your computer and use it in GitHub Desktop.
Testando modelo #1
#!/usr/bin/python
from django.core.management import setup_environ
from people import settings
setup_environ(settings)
from people.models import *
usuario = Usuario(email = "flavio.cdc@gmail.com")
usuario.save()
print Usuario.objects.all()
agenda = Agenda.objects.create(usuario = usuario)
print usuario.agenda
usuario.agenda.contatos.create(nome="Gabi", telefone="123")
print usuario.agenda.contatos.count()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment