Re: [Django] #34608: Migrations generates code that it can't execute

2024-05-06 Thread Django
#34608: Migrations generates code that it can't execute
---+--
 Reporter:  Michael|Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Migrations |  Version:  5.0
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Sarah Boyce):

 * resolution:   => invalid
 * status:  new => closed

Comment:

 Hi Micheal, thank you for providing more information here. Django does
 generate migrations that cannot be applied.
 The generated migration file usually reflects what you have asked Django
 to do and it can only apply successfully if it is "valid".
 Here `User` is dependant on `PermissionsMixin` (it is possible that
 `PermissionsMixin` has some fields defined on it for example) and
 `PermissionsMixin` is dependant on your locals as this is an output of a
 function ran at startup. IMO you can simplify your code to have a valid
 migration generated.

 If you need any support with your project, please use one of our support
 channels such as the [https://forum.djangoproject.com/c/users/6 Django
 forum]. It is recommended to go there first and confirm with others if
 there is agreement that this is either a bug in Django or something new
 Django should support.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f4ce9b7be-cef9b5a3-64a7-43ee-8d41-d1fee8f26038-00%40eu-central-1.amazonses.com.


Re: [Django] #34608: Migrations generates code that it can't execute

2024-05-03 Thread Django
#34608: Migrations generates code that it can't execute
---+--
 Reporter:  Michael|Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Migrations |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Comment (by Michael):

 I created a minimal reproducible example:
 https://github.com/mangelozzi/djangomigrationbug

 1. Check accounts/migrations/0001_initial.py
 2. You will see this line
 bases=(plug.permpp.PermissionsMixin_factory..PermissionsMixin,
 models.Model, accounts.modelpp.NiceNameMixin),
   - It has an error ``
 3. Delete the above migration file
 4. Run python manage.py makemigrations
 5. The file above with the error will be created by the Django.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f3ed166af-0670d99f-eb24-45ec-9591-58241d4305d1-00%40eu-central-1.amazonses.com.


Re: [Django] #34608: Migrations generates code that it can't execute

2024-05-03 Thread Django
#34608: Migrations generates code that it can't execute
---+--
 Reporter:  Michael|Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Migrations |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Michael):

 * version:  4.0 => 5.0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f3ea3a4ba-1521b1ce-4245-4806-941d-a83d46ced694-00%40eu-central-1.amazonses.com.


Re: [Django] #34608: Migrations generates code that it can't execute

2024-05-03 Thread Django
#34608: Migrations generates code that it can't execute
---+--
 Reporter:  Michael|Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Migrations |  Version:  4.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Michael):

 * resolution:  invalid =>
 * status:  closed => new

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f3ea0f1c2-062219e2-4e63-4523-8fd4-1ddbc39f2f34-00%40eu-central-1.amazonses.com.


Re: [Django] #34608: Migrations generates code that it can't execute

2024-05-03 Thread Django
#34608: Migrations generates code that it can't execute
---+--
 Reporter:  Michael|Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Migrations |  Version:  4.0
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Comment (by Michael):

 Hi, there is not an error or bug in my code. Django generates code that
 cannot run. My code runs fine. Everytime I generate migrations, I have to
 manually edit them so they are runnable. This is a bug in Django.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f3ea0a58f-f932511c-a1ab-4492-8ad7-4c4a03722fed-00%40eu-central-1.amazonses.com.


Re: [Django] #34608: Migrations generates code that it can't execute

2023-05-30 Thread Django
#34608: Migrations generates code that it can't execute
---+--
 Reporter:  Michael|Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Migrations |  Version:  4.0
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Natalia Bidart):

 * keywords:  make migrations =>
 * status:  new => closed
 * resolution:   => invalid


Comment:

 Hello!

 First of all, please note that you are using a version of Django that is
 no longer supported (4.0.1).
 Secondly, the error seems to be caused by either:

 1. a possible misconfiguration/bug in your code, or
 2. the result from squashing the migrations is somehow invalid.

 For the first case, the recommended approach is to first ensure whether
 the error you are getting is a bug in Django itself, or not in your code.
 To do that, you can follow
 [https://docs.djangoproject.com/en/4.2/internals/contributing/bugs-and-
 features/#reporting-bugs the bug reporting guide] and seek help in the
 Django User channels to evaluate whether your problem is caused by a
 configuration issue.

 For the second case, we would need a minimal example of two working
 migrations and their minimal models that, when squashed, would generate
 the invalid result. It's important to try to narrow the models and
 migrations to the bare minimum that triggers the issue, and that what's
 shared in the bug is fully functional. At the very least we'd need the
 migrations that were squashed down to the result you pasted in this
 report.

 Closing this ticket as invalid for now, but if you find a concrete bug in
 Django itself or if you can provide a reproducer for the faulty squashed
 migration, please let us know and we'll analyze this further. Thanks!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701886dae03be-dae0115f-6df9-488b-81b0-c3e2a58e3da1-00%40eu-central-1.amazonses.com.


Re: [Django] #34608: Migrations generates code that it can't execute

2023-05-30 Thread Django
#34608: Migrations generates code that it can't execute
-+--
 Reporter:  Michael  |Owner:  nobody
 Type:  Uncategorized|   Status:  new
Component:  Migrations   |  Version:  4.0
 Severity:  Normal   |   Resolution:
 Keywords:  make migrations  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Michael):

 Changing this line from:
 {{{
 bases=(core.djpp.permpp.PermissionsMixin_factory..PermissionsMixin,
 models.Model, djpp.modelpp.NiceNameMixin),
 }}}
 to:
 {{{
 bases=(models.Model, djpp.modelpp.NiceNameMixin),
 }}}
 Make it work fine, since `PermissionsMixin` does not define any DB fields,
 is just run time behavior, but I thought this issue might highlight an
 underlying problem.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701886dacad65-4fc2fcc5-df85-4a82-b5d9-8882eeba9f7f-00%40eu-central-1.amazonses.com.