First post, creating first Django project and having a of an issue I
was hoping for some help with!
I'm trying to write my own search which takes as input a user's
location and returns a list of places (from my db) sorted by
proximity. Here's roughly what I've got:
in models.py:
class Place(mode
Hi,
to access a model in the view, simply import it into you view.
Something along the lines:
from yourapp.models import Place
from django.http import HttpResponse
def some_view(request):
OBJECT_ID = 1 # put here the id of the object
# or give it as a function arg
2 matches
Mail list logo