-
Notifications
You must be signed in to change notification settings - Fork 35
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
Convert relationships for Enclosure, Episode, Sites into M2M to allow mix and match show creation #16
Conversation
update admin form to include enclosure on episode;update models to make slug unique in all cases because of the m2m relationships with shows and sites; update forms to include enclosure on the episode admin panel; update migration to include the model change for slug modify model for enclosure to make episode a ManyToManyField rather than having a ForeignKey on the Episode. This will continue to allow Episodes to have Enclosures of various types and Enclosures to be used on multiple Episodes; modifiy migrations to match updates to form to validate that only one enclosure for each mimetype can be attached to a particular episode corrections to the validation of the Enclosure model admin form and the migration to properly handle AutoSlug update managers and views to use the plural form for sites and shows for the new ManyToMany field; update the model to use the first shows slug when there is more than one and the current show it not known update the ordering of enclosures to include the url because the MimeType alone provides a fairly random list fix typo in the migration script
update fork branch from rizumu repo
update fork branch from rizumu repo via master
I pushed a fix to master to exclude the migrations directory from the linting. You can merge master in to your branch or cherry-pick that commit. Then you'll want to run |
exclude migrations -- merge master from rizumu
merge down master in to branch
…PS setting for licenses rather the only looking for the ability to import licenses; this is because the migration will fail if the module is installed but not in the INSTALLED_APPS with an obsure error; also moved the creation of the ForeignKey to an Alter portion of the initial migration so the dependency is not created with License since it might not be installed
It's interesting that it passes tests (or at least the build succeeds) on some newer versions of Django, but not others. I think we are down to actual test failures now. mostly where I've changed site to sites and episode to episodes and such. Can I assume we are looking for success on all of the Travis environment tests? . |
…se a model form without a fields declaration is deprecated, which makes this class purposeless; Update Forms to add duration to EnclosureForm so it can be used for AdminEnclosureForm; update tests to take into account the ManyToMany fields now present. All tests passing in Python 2.7 and Django 1.7
It appears there is one failure on the Python 3.3 version of the django master branch. I'm stumped on that one really. The last commit fixed an issue with the str def that should have been an issue forever and always on Python 2.6 according to the interwebs. So what do you think? Thanks, |
@djangolackey sorry, somehow this slipped past me. I'll test it out locally and get back to you asap. |
@djangolackey I've tried to keep it as simple as possible, but I'm not able to get the migration working. The steps I've taken are:
If it is working for you, could you please list the steps that you are taking? I'd like to get this merged, but if it is too much trouble to get the migrations working, we can look into doing a manual migration: ex.
|
I'm sorry I've been out of pocket for a couple of weeks. There was an issue with how django-licenses is loaded. Depending on whether licenses is present or not you have to alter the model field from a varchar to a foreignkey. I'm testing another option where the field isn't created except through the check. I'll let you know when I complete my tests. I've chosen not to depend on whether the app available on the path, but instead to check the settings.INSTALLED_APPS for it. This way even if it's available, it won't be used unless it's actually in the installed apps. thanks, |
…nstalled apps rather than creating it as a varchar and converting it to a foreignkey if the app is installed. This is because if the initial isn't run at database creation the license has to be converted, which forces migration to try and treat it as a varchar to foreignkey conversion that it can't accomplish
I've pushed an update that changes the initial migration. Rather than setting the field as a varchar and then converting it to a foreignkey if the Licenses app is installed, I'm delaying the creation of that field until after other pieces are done and basing the creation on the presence of licenses in settings.INSTALLED_APPS. The benefit here is that the field doesn't have to be converted if the app exists, which appears to be where the error is coming from. One thing to note, if a person installs django-podcasting and runs manage.py migrate without licensing in their INSTALLED_APPS and then later adds licensing to their INSTALLED_APPS, they will have a bad time. This is because the field will get created as a varchar field, which will not work with a ForeignKey. They will have to migrate the Field themselves to get it to work. The only other option is to create both a varchar and a foreignkey (only if licenses is installed) and modify the forms.py to only show one of the fields in the admin depending on if licenses is present. I'm not sure if you want to speak to this in the docs, or what. Thanks, |
…hat it creates under postgres
Latest push handles the initial migration differently for the license app. I've set up a postgres database and tested it there. Issue was the the migrations.RunPython doesn't actually handle the migrations.AddField functionality correctly. I needed to add the conditional for licenses in an different way. |
@djangolackey I'll test this out in the next couple days and get it merged asap. Sorry for the delay. |
…is set up like the intended model
@djangolackey everything looks good. I'll need some time to update my custom forms on my project before I can start using it, but I'm going to merge this in and tag a new version since everything is now working nicely. |
Convert relationships for Enclosure, Episode, Sites into M2M to allow mix and match show creation
This is based on conversations in issue #15