-
Notifications
You must be signed in to change notification settings - Fork 5
new upload #43
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
base: master
Are you sure you want to change the base?
new upload #43
Conversation
|
Here's the error: The slug being passed in is an empty string, but the regex ".+" only matches one or more characters. Try changing the test to use a slug with more than one character. This is happening in django_mesh/models.py, line 236, in get_absolute_url(). My guess is a slug was never set on the instance or the instance wasn't saved first. Get this working with a slug, then add another test for when there isn't a slug, returning an empty string instead of raising an error. |
|
right, i thought i changed all of it, it seems i missed one! i must have copied it over and accidentally put a + instead of a * in there at one point. Also, i accidentally had args= instead of kwargs= in the models as well |
|
Yeah, looks like we use "" instead of "+" elsewhere, so stick with "". |
|
YESS! it seems its passing the tests now! this branch can replace upload, its pretty much a cleaned up version of upload with the file->media name change. When youre free and can check to make sure it includes everything you want, if everything is good, i can squash the commit and it should be ready to merge |
django_mesh/forms.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that width and height are hardcoded here. I'll have to look at the oembed spec again to see how its best to handle this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about the dimensions in render for the Media class? Those are also hardcoded. should that be user adjustable at some point?
We can add some required dimesion fields and pass that in via string substitution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good catch.
Yeah, let's just add nullable width and height SmallIntegerFields and use that instead of the hardcoded values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the embed tag is non-standard and doesn't work in all browsers. Typically is placed inside an tag.
Does work for non-videos? Was the intent to have the actual file in the index or just a thumbnail image?
|
With regards to the media height and width fields, it didnt have a default set because we still have to figure out what the best/standard dimensions are for the oembed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using the "style" attribute, could you use "width" and "height" attributes? Normally we'd use CSS, but images are a special case and it helps speed up the webpage rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this setting is needed, looks like it's part of this package: https://github.com/nai-central/django-mediafiles/
14805c1 to
e3311ab
Compare
No description provided.