This commit is contained in:
nikolark committed 2014-01-23 19:44:59 +01:00
1 parent 3128fdfc06
commit 6922e9d858
3 files changed
+15

No files matched your search

+5
View File
@@ -11,3 +11,8 @@ class AddressResource(ModelResource):
resource_name = 'address'
authorization = MyDjangoAuthorization()
authentication = OAuth20Authentication()
def dehydrate(self, bundle):
bundle.data['full'] = bundle.obj.full
return bundle
+3
View File
@@ -99,6 +99,9 @@ class Address(AbstractBaseModel):
city = models.CharField(max_length=100)
country = models.ForeignKey('dusken.Country', null=True, blank=True)
@property
def full(self):
return self.__unicode__()
class Country(AbstractBaseModel):
class Meta:
+7
View File
@@ -97,12 +97,19 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_ROOT = 'staticfiles'
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
# Our own User class used for authentication.
AUTH_USER_MODEL = 'dusken.Member'
TASTYPIE_DEFAULT_FORMATS = ['json']
TASTYPIE_DATETIME_FORMATTING = 'iso-8601-strict' # no microseconds
#TASTYPIE_FULL_DEBUG = True
CORS_ORIGIN_ALLOW_ALL = True
# Allow Ajax calls only from tuple of domain:port