Closed SalahAdDin closed 1 year ago
Hi @SalahAdDin,
Hope you are well, you are right v3 will not install over an old version as the migrations were all binned due to it being re-written. None of the old tables now exist with the exception of the FormSubmission.
The only way currently to get this on an existing install is to first loose the old one, db tables, migration rows in the django_migrations
table also, then go from there.
http://wagtailstreamforms.readthedocs.io/en/latest/#backwards-compatibility
That being said I may actually look at this tonight and see if it can be fixed, though I dont know if its a priority as im not sure if we are putting it on pypi or just leaving it in the repo
Cheers Stu
Further more the reason u see No changes detected
is that v3 only has 0001_initial.py
as a migration and that already exists as part of the old one, if you delete the tables and that row in django_migrations
it should go on ok.
@stuartaccent But if we delete all tables will lose all data content, that's why we need migrations.
@SalahAdDin
I appreciate that totally and it has been on my mind since we started this, if we do release it on pypi we will probably have to look at this though there will still be things to overcome.
The old package allowed additional form models to be created that we would not know the additional model fields that were created in these only what we expect the models to have for the form only. We would be not be able to handled these as there is no where to put them. Nor would we be able to see them without rewinding the code base to deal with these before all the code was removed.
Things like the email sending is now a hook and its expected that this functionality is in the installing apps code base via the hooks, so we could not do anything with this data either.
Fields would need to be converted to the StreamField StructValue, doable i reckon.
The recaptcha part requires a field to be created also which is on a app by app basis.
If we try to create the migrations to upgrade the existing tables i'm not sure then we could do it in a way where it wouldn't force the loss of data. Which is why we decided in the first place 2 would not be upgradable to 3. If anyone has got any ideas i'm all ears :)
Short of making this a separate package entirely and allowing the install side by side I don't know what we can do as it's model layout is totally different to the original spec :(
Stu
@stuartaccent It's a very complex situation, by my lucky i haven't data, so, i can change it easily, but...
@SalahAdDin will see what i can come up with but will be far from ideal and i really dont want people to just upgrade then realise things have been lost :(
Yes, i thing the same.
@stuartaccent what happened with email forms
, and regex
validators?
Hi @SalahAdDin. Am on my phone at the minute but when I get home will write up in an issue what our thoughts and plans are for this and the changes. This should help answer any questions like this in one place.
Cheers. Stu
Hi @SalahAdDin hope #90 explains things :)
@stuartaccent, i think many people came to this repo because they did want no make form by herself, that's why built-in form were greatful; at least you can provide a email form
and regex
validators example.
@SalahAdDin, the example hook in the docs is the email one http://wagtailstreamforms.readthedocs.io/en/v3.0.0/hooks.html#create-your-own-hook.
I will add the validator field example too when i get a sec :)
We need to extend the new Form model, right?
Nope you just need to register a new field like in the example pr #91 , docs for adding new fields are here
I mean, if we want create a new email
form, we have to extend the form model, right?
Extending the models was removed in favour of providing hooks to add the required functionality. As I linked above http://wagtailstreamforms.readthedocs.io/en/v3.0.0/hooks.html#create-your-own-hook has an example with how to create a hook to do this.
While we also appreciate removing functionality is not good, v3 was created only for our own benefit which is why we are not publishing it as outlined in #90.
Cheers, Stu
Email form and news letter form is interesting feature.
Hi, Email is def something we are gonna look at. We always had the idea of being able to define templates in the ui or integration with a third party package. but originally we had no time for it. Now we have the time we are gonna look at it in more detail. I am keen not to just replicate what we did originally as it brings alot of what seemed like pointless code for what was just an email and want to make sure the end user can define the email in its enterity. Am also keen keep the form model to just handle the form if you know what i mean.
If you have any idea or good packages to either get ideas or integrate shout.
Ty :)
No, i didn't understand, sorry. XD
I decided install and test the new version and i have the next problem:
As you can see there is no changes or new migrations in this version, but i get a problem with tables, that's because i used the previous version before.
There is any solution for this problem?