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

Django object pattern, in order to match for example a numeric id in URI... #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

domguard
Copy link

... with the readable object slug for the HTML document

I could not avoid a db request, it's ok for a non-intensive usage, like a RDF API.
Syntax is :

  • must use named group for the URI pattern , named after the matching field, like (?P\d+)/$
  • for the redirect pattern : "http://something.com/@id:my_django_app.my_model_name@/"
    the same id field used in the URI pattern, a colon and the app and model names joined with a dot, wrapped into two "@" for easier matching.

I really like uriredirect, registries are a great improvement over uriresolve which I had tested before.
If you think this feature can be merged, I'll make tests for it and documentation patch if you're not afraid of my english.

…URI with the readable object slug for the HTML document

I could not avoid a db request, it's ok a not-intensive usage, like a RDF API.
Syntax is :
- must use named group for the URI pattern , named after the matching field, like (?P<id>\d+)/$
- for the redirect pattern : "http://something.com/@id:my_django_app.my_model_name@/"
  the same id field used in the URI pattern, a colon and the app and model names joined with a dot, wrapped into two "@" for easier matching.
@rclark
Copy link
Contributor

rclark commented May 25, 2012

If I understand correctly, what you have done is allow for a way to provide URIs that redirect to specific Django objects, perhaps parts of other apps on your server.

While I can see the usefulness of this in some situations, right now I'm trying to keep the functionality as generic as possible: simply map some URI pattern to a URL somewhere else on the internet.

I appreciate your interest in the project. The next thing that I'm thinking about is figuring out what it might take to build a "registry of registries". This would be a sort of "master" server so that URI requests to any instance of the application could forward those requests to the correct instance that knows how to resolve it.

@domguard
Copy link
Author

Yes, in fact I use your application as a standard 303 redirection engine for Linked Data :
depending on content-negotiation, the application serves RDF or HTML.

But, as any web application, having nice URLs is also needed (for people, for SEO, etc)
So as we're talking about django it seemed logic to give access to django objects attributes involved in making up their own URLs.
AFAIK, the code does not modify previous functionalities, but if your prefer to not commit it, I'll just live with my fork and pull upgrades when you'll have some !

@rclark
Copy link
Contributor

rclark commented May 25, 2012

Yes, I see why this could be helpful, and it certainly doesn't affect any existing functionality. I'll leave the request open -- there are a couple of my collaborators that might like to have a look.

Thanks again for your interest and support.

…URI with the readable object slug for the HTML document

I could not avoid a db request, it's ok a not-intensive usage, like a RDF API.
Syntax is :
- must use named group for the URI pattern , named after the matching field, like (?P<id>\d+)/$
- for the redirect pattern : "http://something.com/@id:my_django_app.my_model_name@/"
  the same id field used in the URI pattern, a colon and the app and model names joined with a dot, wrapped into two "@" for easier matching.
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.

2 participants