Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource urls now accept alphanumeric primary keys #273

Closed
wants to merge 1 commit into from

Conversation

llonchj
Copy link

@llonchj llonchj commented Oct 25, 2011

I have an app with a Model imported from a table (inspectdb) with a CharField primary key. The patch supports other types as primary key with backwards compatibility.

By trying to get the object with a RESTful call, i was unable to get a object by primary key:

/api/v1/model/my_primary_key/?format=xml

After applying this patch it works and tests passed for me.

Best Regards,
Jordi

@sankio
Copy link

sankio commented Apr 27, 2012

The patch works for me, too.

@svdgraaf
Copy link

svdgraaf commented May 9, 2012

Works here too, please pull this, it's awesome :)

hadesgames added a commit to hadesgames/django-tastypie that referenced this pull request May 27, 2012
@llonchj
Copy link
Author

llonchj commented Jun 1, 2012

Thanks!

@llonchj llonchj closed this Jun 1, 2012
@llonchj llonchj reopened this Jun 1, 2012
@roysmith
Copy link

+1 on this. I just got bit by exactly this problem. The primary key for my model has dots in it. Not allowed. In my case, the punctuation is somewhat arbitrary so I worked around it by changing the dots to dashes, but none of this should be necessary. Allow anything that's not a slash in the pattern.

@rhfung
Copy link

rhfung commented Aug 7, 2013

roysmith, I just ran into the same problem where TastyPie coughs when the primary key contains a dot (.). I worked around the issue by replacing dots with underscores (_).

georgedorn added a commit to georgedorn/django-tastypie that referenced this pull request Aug 20, 2013
georgedorn added a commit to georgedorn/django-tastypie that referenced this pull request Aug 20, 2013
@georgedorn
Copy link
Contributor

Closed by #1013.

@georgedorn georgedorn closed this Aug 20, 2013
nikmolnar pushed a commit to nikmolnar/django-tastypie that referenced this pull request Jun 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants