Created
April 5, 2014 08:58
-
-
Save nwcell/9989312 to your computer and use it in GitHub Desktop.
Trouble with TasyPie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Provider(models.Model): | |
name = models.CharField(max_length=50) | |
class Meta: | |
verbose_name_plural = "Providers" | |
def __unicode__(self): | |
return self.name | |
def get_absolute_url(self): | |
return reverse('provider.views.provider', args=(self.pk,)) | |
class ProviderResource(object): | |
class Meta: | |
queryset = Provider.objects.all() | |
resource_name = 'provider' | |
v1_api = Api(api_name='v1') | |
v1_api.register(ProviderResource()) | |
urlpatterns = patterns( | |
'provider.views', | |
(r'^api/', include(v1_api.urls)), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment