Re: django.db.utils.OperationalError: no such table abc

2021-10-24 Thread David Nugent
On Fri, Oct 22, 2021 at 7:09 AM Ammon Quackenbush 
wrote:

> I think you are right. I did delete the initial migration. How do I
> restore the initial migration?
>
>
Can't you restore it from your git repo?  If you're not running any sort of
version control you've just hit the reason why doing so is important.

If that is not an option then it can be tricky.

If you have the luxury of backing up your existing data (e.g. using
dumpdata), then you can wipe your entire database, run makemigrations,
migrate and then re-import your data.  This is the most straight-forward
method, but depending on the size of your data may take a while. This would
be my recommended way as it is the safest way to restore your migrations
state.

On a lesser extreme, and depending on the exact nature of your error and
whether current tables are otherwise up to date wrt your models (if not you
may run into issues), you can also reset or drop django_migrations table,
remove migrations for apps with missing migration files, run makemigrations
to re-create them (without any history) then migrate --fake to re-create
and re-populate the django_migrations table which will not affect existing
tables.


HTH, David

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE5VhgWNvOzjtdYxMo-GX%2B0famY3TQn08yv_BAXpXm1Xc3%3DoyA%40mail.gmail.com.


Re: Creating some fields on the fly in django template

2021-10-24 Thread Ammar Mohammed
Hello
In your case i wouldn't import all the form at once using, {{ form.as_p}}

Instead try to import every single field of your form thenyou can use
JavaScript to show and hide fields according to input because django can't
do this kind of editing.


On 24 Oct 2021 7:32 PM, "Dina Dodin"  wrote:

Hi

i have forms (not using Models)
in some forms i want to introduce dropdown list for example in case some
specific value is selected for another existing form field.

i tried something if found in google but nothing seems to work for me.

if someone can help me with it will be great!

in html template i get the form as this: {{ form.as_p }}
i want to show/hide a new field according to value i select of existing
field value.

-- 
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/4974223a-7544-4934-8f1f-e07675590d44n%40googlegroups.com

.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHs1H7uWigr_Z6kQHb%3DbZE3F-JXrj7JA-y9T5zWVn15fkmvdMw%40mail.gmail.com.


Creating some fields on the fly in django template

2021-10-24 Thread Dina Dodin
Hi

i have forms (not using Models)
in some forms i want to introduce dropdown list for example in case some 
specific value is selected for another existing form field.

i tried something if found in google but nothing seems to work for me.

if someone can help me with it will be great!

in html template i get the form as this: {{ form.as_p }}
i want to show/hide a new field according to value i select of existing 
field value.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4974223a-7544-4934-8f1f-e07675590d44n%40googlegroups.com.