Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/d/j/django-forumbr-0.4.0.1/forum/views.py   django-forumbr(Download)
    def post(self, request, *args, **kwargs):
        next = request.REQUEST.get('next', None)
        profile, created = Profile.objects.get_or_create(user=request.user)
        # TODO: make this a event
        box = MessageBox.objects.get_or_create(profile=profile)

src/d/j/djangoproject.com-HEAD/accounts/views.py   djangoproject.com(Download)
def edit_profile(request):
    profile, created = Profile.objects.get_or_create(user=request.user)
    form = ProfileForm(request.POST or None, instance=profile)
    if form.is_valid():
        form.save()

src/d/j/django-pyodbc-HEAD/tests/django16/get_or_create/tests.py   django-pyodbc(Download)
        # otherwise the exception is never raised.
        try:
            Profile.objects.get_or_create(person=Person(id=1))
        except IntegrityError:
            pass

src/u/p/UP-Manager-0.0.0/tests/get_or_create/tests.py   UP-Manager(Download)
        # otherwise the exception is never raised.
        try:
            Profile.objects.get_or_create(person=Person(id=1))
        except IntegrityError:
            pass

src/d/j/Django-1.6.4/tests/get_or_create/tests.py   Django(Download)
        # otherwise the exception is never raised.
        try:
            Profile.objects.get_or_create(person=Person(id=1))
        except IntegrityError:
            pass