Re: [Django] #24686: Support for Moving a model between two Django apps

2024-04-08 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Sarah Boyce):

 * needs_better_patch:  0 => 1

Comment:

 Marking as patch needs improvement as I failed to follow the instructions
 in the docs successfully, so I don't think they're quite clear enough.
 I plan to do a series of tests once I understand what I should be doing 
 exciting feature!
-- 
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/0107018ebce2ae2f-5155d5ab-dfea-40ef-925b-c276082fe6dd-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-12-27 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by David Wobrock):

 * cc: David Wobrock (added)


-- 
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/0107018cac0bb365-ca022937-04f0-4ea2-8ea5-b68d431085df-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-12-24 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Bhuvnesh):

 Sorry! I completely misunderstood what maarten was trying to say. Thanks
 for the clarification Shai.

 >>The auto detector will see it as the deletion of model in the old app
 and creation of that model in the new app. This will also lead to losing
 all the data associated with that model.

 This will happen if you change just the app_label of model to the
 app_label of app you want to move the model and not actually move the
 model code. For example, you have SampleModel in app_a and you want to
 move it to app_b, so you just added app_label=app_b in SampleModel's Meta
 and not actually moved the model code to app_b.

-- 
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/0107018c9e1dda55-c97a9bb8-1d6c-48c9-b127-487006e365e7-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-12-24 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Shai Berger):

 Replying to [comment:33 Maarten Nieber]:
 > I've been struggling with this issue for a while, and came upon an
 extremely simple (though not perfect) solution. Things seem to keep
 working fine if I move the model code to a new django app, and set the
 "app_label" field in the Meta class to point to the old django app.
 >
 > I have two questions:
 >
 > - is this totally fine to do, and expected to work?

 I disagree with Bhuvnesh above: I expect this to work, in the sense that
 your project should continue to run, and no migration will be necessary.

 But it's "cheating" -- the model's ''code'' has been moved to a different
 ''file'', but the model is still in the old app for all other purposes: If
 you make a change in it, the migration will still be created in the old
 app. If you try to remove the old app, things will break. Anywhere you'd
 want to reference it by name (e.g. in a Foreign Key definition), you'll
 need to refer to it with the label specified in its meta, not the label of
 the app in whose {{{ models.py }}} it is defined.

 > - should we explain in the Docs that this is a simple and effective way
 to move a model?

 ... and the above is why I think we shouldn't. I expect doing this --
 creating a discrepancy between the model's import path and the way Django
 treats it -- is likely to cause problems and confusion, negating the value
 of the refactoring that is achieved by the move.

 The ability to change the app-label in the {{{ Meta }}} is mostly useful
 in cases where you want a model defined outside of its app's {{{ models.py
 }}}; there are sometimes reasons to do this (e.g. a model that is defined
 for tests only).

-- 
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/0107018c9deddfa2-7da2876e-9b54-4d24-9c44-cff88a9e0d6d-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-12-17 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Bhuvnesh):

 Hi Maarten!
 I don't think moving the model code to the new django app and setting the
 app_label to point to the old django app will work. The auto detector will
 see it as the deletion of model in the old app and creation of that model
 in the new app. This will also lead to losing all the data associated with
 that model.
 There is a [https://github.com/django/django/pull/16905 PR] open for
 addressing this issue which was working pretty good when the last time I
 tested it. I would suggest switching to that branch and try the same you
 suggested above (if possible) and it should work fine without any data
 loss. You can also have a look at the working of this new feature
 [https://github.com/DevilsAutumn/moving-model-demo#10-moving-model-by-
 just-changing-app_label-in-models-meta here.] Let me know if you face any
 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/0107018c77c7be82-04e81164-0b46-48e9-9f1e-ed451a0bd079-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-12-17 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Maarten Nieber):

 I've been struggling with this issue for a while, and came upon an
 extremely simple (though not perfect) solution. Things seem to keep
 working fine if I move the model code to a new django app, and set the
 "app_label" field in the Meta class to point to the old django app.

 I have two questions:

 - is this totally fine to do, and expected to work?
 - should we explain in the Docs that this is a simple and effective way to
 move a model?

-- 
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/0107018c77382296-82247ae5-e260-4cb3-96ca-e30da5c5eeb7-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-11-21 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Mariusz Felisiak):

 * cc: Simon Charette, Shai Berger (added)
 * needs_docs:  1 => 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/0107018bf158f971-64d05cdd-ec6b-435e-8f89-0392b22d917b-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-07-23 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Mariusz Felisiak ):

 In [changeset:"f05cc5e3d2ae7663dbd248029bcb74500cf1029f" f05cc5e3]:
 {{{
 #!CommitTicketReference repository=""
 revision="f05cc5e3d2ae7663dbd248029bcb74500cf1029f"
 Refs #24686 -- Made AlterField operation a noop when renaming related
 model with db_table.
 }}}

-- 
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/0107018983a3b837-f39fa461-eeef-47a0-b988-b2ee00c0a239-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-06-23 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Simon Charette):

 If that can be of any help this problem and a potential solution that
 doesn't involve using `SeparateDatabaseAndState` was discussed in a
 related ticket https://code.djangoproject.com/ticket/34673#comment:2

-- 
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/01070188e8bc277b-81bd9b29-5453-4e99-9b59-5d1c10a0f19f-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-05-09 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  Bhuvnesh
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Bhuvnesh):

 * owner:  Durval Carvalho => Bhuvnesh


-- 
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/0107018803e3b92f-be6b0a5f-c847-4c6c-bc6d-fcf16b5324d1-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-03-21 Thread Django
#24686: Support for Moving a model between two Django apps
---+---
 Reporter:  Alex Rothberg  |Owner:  Durval Carvalho
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+---
Changes (by Mariusz Felisiak):

 * needs_docs:  0 => 1


-- 
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/01070187032b73cc-3ba1d6a4-a2f6-47ad-9a75-b9ddf90aeddb-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-03-20 Thread Django
#24686: Support for Moving a model between two Django apps
---+---
 Reporter:  Alex Rothberg  |Owner:  Durval Carvalho
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+---

Comment (by Mariusz Felisiak):

 Personally, I'd rather add a new migration operation than abuse
 `SeparateDatabaseAndState()`.

-- 
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/01070186ff27a1b8-39067a62-a4b0-4f80-b7d9-bc6deee99979-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-03-20 Thread Django
#24686: Support for Moving a model between two Django apps
---+---
 Reporter:  Alex Rothberg  |Owner:  Durval Carvalho
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+---

Comment (by Mariusz Felisiak):

 There is also an alternative [https://github.com/django/django/pull/16585
 PR].

-- 
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/01070186ff0b713f-cfe28fa7-3ae4-419b-a63e-6e03ec88c552-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-03-20 Thread Django
#24686: Support for Moving a model between two Django apps
---+---
 Reporter:  Alex Rothberg  |Owner:  Durval Carvalho
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+---
Changes (by Jacob Walls):

 * needs_docs:  1 => 0
 * needs_tests:  1 => 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/01070186feec2ef2-db1e0113-6a29-49c8-8268-6b53f9923a4c-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-03-03 Thread Django
#24686: Support for Moving a model between two Django apps
---+---
 Reporter:  Alex Rothberg  |Owner:  Durval Carvalho
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+---

Comment (by Durval Carvalho):

 Recently, I’ve been thinking about how reverse migrations might work with
 moved model operations.

 To illustrate, let’s take an example of a scenario where the following
 operations were performed:

 {{{
 1. The database operation AlterModelTable, renaming the table for the
 moved model
 1.1. (suppose it is ‘core_category’ → ‘categories_category’)
 2. The state operation CreateModel
 3. The AlterField of the foreign keys pointing to the moved field
 3.1. Supose it is core.category → categories.category
 4. The state operation DeleteModel
 }}}


 By default, the reverse of these operations will be 4 → 3 → 2 ->1.
 However, it’s not possible to execute operation number 3 because the table
 hasn’t been renamed yet. The reverse operation will try to update the
 foreign key field back to core.category and this will be translated to the
 core_category table, however this table does not exist in the database at
 this point.

 As far as I understand, the reverse operation needs to follow the same
 sequence as the initial operation (1->2->3->4), but with the fields
 reversed, ‘categories_category’ → ‘core_category’ and categories.category
 → core.category.

 To resolve this and return to the previous state, one option is to move
 the model back to its original app and then run the “makemigrations”
 command again. However, keep in mind that this will generate new
 migrations instead of reverting the ones that have already been executed.

 Does this approach seem reasonable to you?

-- 
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/01070186a940b1aa-1a043dc2-9af5-4b30-b7fe-324f085d569b-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-03-01 Thread Django
#24686: Support for Moving a model between two Django apps
---+---
 Reporter:  Alex Rothberg  |Owner:  Durval Carvalho
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+---

Comment (by Durval Carvalho):

 Hi everyone, I'm working on this ticket and I want to make sure that the
 new functionality will meet all the necessary scenarios. So far, I've
 identified some scenarios that the feature should cover, such as moving a
 single model, moving multiple models that are independent, and moving
 models from an app that no longer exists. Are there any other scenarios
 that I should consider? Your feedback would be greatly appreciated. Thank
 you!

-- 
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/010701869ed26dea-33ed907a-057b-4992-8471-3c205519907a-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-02-22 Thread Django
#24686: Support for Moving a model between two Django apps
---+---
 Reporter:  Alex Rothberg  |Owner:  Durval Carvalho
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+---

Comment (by Durval Carvalho):

 I would like to ask for feedback on my approach. I have found what I
 believe to be the best way to move a model from one app to another in
 Django. It involves four separate operations in at least 3 different
 migrations:

 **1.** Rename table operation: renames the physical table name on the
 database. This operation should be a SeparateDatabaseAndState operation
 and only change the database, without changing any state.

 **2.** Create table operation: moves the model code to the new app, and
 creates a CreateModel only in state, with a SeparateDatabaseAndState
 operation.

 **3.** Update all foreign keys that point to the moved model.

 **4.** Delete the old model table, but only in state, using a
 SeparateDatabaseAndState operation.

 I've implemented this logic in a new method called "generate_moved_models"
 in MigrationAutodetector. I've discovered that the current implementation
 only handles simple ForeignKeys and not more complex cases like
 ManyToManyFields. This is because the current approach generates at least
 one AlterField with the fields ManyToOneRel and ManyToManyField, which
 cannot be serialized at the time of writing operations to the migration
 files.

 I'm still trying to figure out the best approach to tackle this issue. I'm
 unsure whether extending the serializer_factory to support these types of
 fields or creating a new operation (probably "MoveModel") similar to
 RenameModel would be the better solution. I noticed that in the
 RenameModel the operations related to column renaming in the M2M tables
 are done in the database_forwards method using the _alter_many_to_many.

 If anyone in the Django community has any suggestions or experience with
 this issue, I would greatly appreciate any input. Thank you!

-- 
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/010701867ab0c462-7cf01273-6a81-4d27-b3e1-bcec281866d1-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-02-05 Thread Django
#24686: Support for Moving a model between two Django apps
---+---
 Reporter:  Alex Rothberg  |Owner:  Durval Carvalho
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+---

Comment (by Durval Carvalho):

 Hi there! I've started working on this ticket and I've opened a PR with my
 progress so far at https://github.com/django/django/pull/16523. I'm having
 a little difficulty understanding the **autodetector.py** code but I
 believe it's just a matter of spending more time with it. I discovered
 this ticket through the gsoc2023 blog post for Django and I'm planning to
 create a proposed solution once I figure out how to implement it. I'm
 excited to be able to collaborate with my favorite framework!

-- 
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/0107018622ce173d-5d80d0cb-1a68-4460-8039-f959bae6899d-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2023-01-31 Thread Django
#24686: Support for Moving a model between two Django apps
---+---
 Reporter:  Alex Rothberg  |Owner:  Durval Carvalho
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+---
Changes (by Durval Carvalho):

 * owner:  (none) => Durval Carvalho
 * status:  new => assigned


-- 
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/0107018609c97cbe-3f265daa-7df1-46f2-8988-9c5bb859b151-00%40eu-central-1.amazonses.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2020-12-27 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  (none)
 Type:  New feature|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Jacob Walls):

 * needs_tests:  0 => 1


-- 
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/067.9a772e311968a73a51bf35d311d21e37%40djangoproject.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2020-07-29 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  (none)
 Type:  New feature|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Abhishek Bera):

 * owner:  Abhishek Bera => (none)
 * status:  assigned => 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/067.653d4b4c31e53c8a0f6ec61cf3a5fe44%40djangoproject.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2020-07-29 Thread Django
#24686: Support for Moving a model between two Django apps
---+-
 Reporter:  Alex Rothberg  |Owner:  Abhishek Bera
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+-

Comment (by Abhishek Bera):

 Update: This is the commit if someone needs it
 
https://github.com/berabhishek/django/pull/1/commits/2a92314a3effca22a43219fcbdfdc6add9ccaf66

-- 
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/067.3e03587ae0f31eb0130434ef3fdca5ea%40djangoproject.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2020-07-28 Thread Django
#24686: Support for Moving a model between two Django apps
---+-
 Reporter:  Alex Rothberg  |Owner:  Abhishek Bera
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+-

Comment (by Abhishek Bera):

 Hi, I am new to django development so I started with this documentation
 ticket. I am struggling with the level of detail I should mention in the
 document. So far I just updated the param and mentioned what it does. Here
 is the diff :

 ddiff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-
 operations.txt
 index d1620cce8e..f4a444e8e9 100644
 --- a/docs/ref/migration-operations.txt
 +++ b/docs/ref/migration-operations.txt
  ``RenameField``
  ---

 -.. class:: RenameField(model_name, old_name, new_name)
 +.. class:: RenameField(model_name, old_name, new_name,
 new_app_label=None)

  Changes a field's name (and, unless
 :attr:`~django.db.models.Field.db_column`
 -is set, its column name).
 +is set, its column name) or moves the Model to `new_app_label`.

 Also, what should be the branch name for this PR?

-- 
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/067.2e3cd1dd2d87b96f1dfcfaa49c530ce1%40djangoproject.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2020-07-28 Thread Django
#24686: Support for Moving a model between two Django apps
---+-
 Reporter:  Alex Rothberg  |Owner:  Abhishek Bera
 Type:  New feature|   Status:  assigned
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+-
Changes (by Abhishek Bera):

 * owner:  nobody => Abhishek Bera
 * status:  new => assigned


-- 
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/067.056a68883b533af0c6cb8c9f57d5bd1a%40djangoproject.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2019-10-16 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by wtayyeb):

 * has_patch:  0 => 1


-- 
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/067.d1fec6fcaa5d7ef25b366854bd7f80e3%40djangoproject.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2019-10-16 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by wtayyeb):

 Hi again.
 Unlike my previous comment and approach, I found that `RenameModel`
 operation is well written even for moving models, so I update it and
 `MigrationAutodetector` to handle moving models.
 The move mechanism is completely without `SeparateDatabaseAndState` and it
 will produce at least 2 migrations one for old_app and one for new_app
 like below.

 00zz_new_created_migration_at_old_app.py
 {{{#!python
 class Migration(migrations.Migration):
 dependencies = [
 ('new_app', '00xx_some_migration'),
 ('old_app', '00yy_pre_migration'),
 # ...
 ]
 operations = [
 operations.RenameModel(
 old_name='MyModel',
 new_name='MyModel',
 new_app_label='new_app',
 ),
 ]
 }}}

 00vv_new_created_migration_at_new_app.py
 {{{#!python
 class Migration(migrations.Migration):
 initial = True
 dependencies = [
 ('new_app', '00xx_some_migration'),
 ('old_app', '00zz_new_created_migration_at_old_app'),
 ]
 operations = [
 operations.MoveModelPlaceholder(
 old_name='MyModel',
 new_name='MyModel',
 new_app_label='new_app',
 comment='this is a required noop operation to construct
 dependencies for moving model',
 ),
 ]
 }}}

 note that `MoveModelPlaceholder` is a noop operation to construct the
 dependencies and let forward and backward migrations without problem.

 the code is in  [https://github.com/django/django/pull/11920 PR]

-- 
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/067.3d61a33f5adc80bc24d3b06638ad1d30%40djangoproject.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2019-10-15 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by wtayyeb):

 Hi, I have add a method  to `MigrationAutodetector` to let it find moved
 models, originally as a fork of `.generate_renamed_models()`. It will
 create at least 2 migrations with `SeparateDatabaseAndState` to do the
 job.
 i have create a [https://github.com/django/django/pull/11920 PR] for it. I
 try not to alter anywhere else in `MigrationAutodetector`, maybe others
 could do it better without this constrain.

 I have only one problem, I need to mention the migration of rem_app_label
 ( commented in PR ) just before new created one ( which I create ).
 without it forward plan may works, but backward plan may be incorrect
 leading to broken backward migration or even data loss.
 Adding it manually is not an acceptable answer for Django project.

 I dig in code but couldn't find it. anyone can help me?

-- 
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/067.4fa6ccb14f125bbc4c0239b87bab61a8%40djangoproject.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2019-10-10 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by jedie):

 * cc: jedie (added)


-- 
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/067.282afe5dce2d4d35e9236d983c0c19c0%40djangoproject.com.


Re: [Django] #24686: Support for Moving a model between two Django apps

2018-01-25 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Alexandru Mărășteanu):

 In the meantime, I've built a management command to do just that. You can
 find it at [https://github.com/alexei/django-move-model alexei/django-
 move-model]

 If someone cared to take a look and submit some feedback, I'd really
 appreciate it.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.18e559efaa6081b66c4056eb7ef7c633%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24686: Support for Moving a model between two Django apps

2017-01-30 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Petr Dlouhý):

 Maybe this could be separated into two separate tasks.
 We could first create database operation like
 `django.db.models.MoveToApp`. This alone could save a lot of manual work
 and confusion for developers.

 Second stage would be creating the autodetection mechanism, which would
 make migrations with this operation automatically.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.5615b05f84c1372064303236ac143ef9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24686: Support for Moving a model between two Django apps

2016-12-05 Thread Django
#24686: Support for Moving a model between two Django apps
---+
 Reporter:  Alex Rothberg  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Florian Klink):

 I also ran into this today, when pulling some models into a separate app.

 The [http://stackoverflow.com/questions/25648393/how-to-move-a-model-
 between-two-django-apps-django-1-7/26472482#26472482 stackoverflow post]
 does not work anymore as soon as there are cross-app foreign keys, but
 [http://stackoverflow.com/questions/30601107/move-models-between-
 django-1-8-apps-with-required-foreignkey-references/30613732#30613732 this
 example here] does.
 In the solution outlined there, a migration inside the new app depends on
 a migration of the old app
 
([https://github.com/halfnibble/factory/blob/step4/tires/migrations/0001_initial.py#L11
 see here]), so loading all migrations should at least break as soon if you
 remove the old app from INSTALLED_APPS ;-)

 Given the currently needed amount of manual work, we should really try to
 detect these movements and produce migrations like above.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.2c9ba09156f494cacb637aef0ca2725d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24686: Support for Moving a model between two Django apps

2015-04-26 Thread Django
#24686: Support for Moving a model between two Django apps
-+
 Reporter:  cancan101|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Migrations   |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by MarkusH):

 @cancan101, I'm saying that you will have trouble to get the suggested
 migrations work on an empty database once `old_app` is removed from the
 list of installed apps. To be specific, since you already need to fix the
 migration dependencies it's probably not that big of a deal to also drop
 the `SeparateDatabaseAndState` and replace it with a `CreateModel`
 operation.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.268ba49aef5e6cf5dd4528a040e1bcce%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24686: Support for Moving a model between two Django apps

2015-04-23 Thread Django
#24686: Support for Moving a model between two Django apps
-+
 Reporter:  cancan101|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Migrations   |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by cancan101):

 @MarkusH Are you saying that the solution posted on SO won't work?
 I was suggesting the project level migrations to address the issues raised
 by @knbk so that the migrator could see both apps.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.55cd11df53e5c0433207495c1c316459%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24686: Support for Moving a model between two Django apps

2015-04-23 Thread Django
#24686: Support for Moving a model between two Django apps
-+
 Reporter:  cancan101|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Migrations   |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by MarkusH):

 Referring back to the [http://stackoverflow.com/a/26472482 example
 solution from SO]:

 As soon as you remove the `old_app` from installed apps and apply the
 migrations on an empty database the `SeparateDatabaseAndState` operation
 in `new_app` will **only** create the model in memory but **no database
 table**. Therefore it's not an option to migrate data between apps to get
 rid of one app it this simple form.

 Replying to [comment:4 cancan101]:
 > Crazy question, but what about project level migrations?

 What about them? You can define `settings.MIGRATION_MODULES` and put all
 app migrations in your project. But I advice you to not do that unless
 there is a 3rd party app that doesn't have Django migration support. Then
 this is the way to go to add migrations for that particular app.


 Replying to [comment:3 knbk]:
 > I do have some concerns about dependencies. If the migration lives in
 the old app, the autodetector won't be able to detect that the next
 migration in the new app depends on the `RenameModel` migration in the old
 app. Likewise, if the migration lives in the new app, the next migration
 in the old app won't have a dependency on the migration that moves the
 model. The last case ''might'' not be a problem, but I can't say that off
 the top of my head.

 Sounds about right to me. You will eventually run into a hellhole of
 dependencies.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.4d150f4b79920797c9b1529b44c4566f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24686: Support for Moving a model between two Django apps

2015-04-22 Thread Django
#24686: Support for Moving a model between two Django apps
-+
 Reporter:  cancan101|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Migrations   |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by cancan101):

 Crazy question, but what about project level migrations?

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.a3e52382340f704edd784a5b85851761%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24686: Support for Moving a model between two Django apps

2015-04-22 Thread Django
#24686: Support for Moving a model between two Django apps
-+
 Reporter:  cancan101|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Migrations   |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by knbk):

 An actual implementation would supersede #24016.

 I don't think the operation to move a model to another app has to be
 significantly more complex that the current `RenameModel`. The
 autodetection, on first sight, is just a matter of removing this check:
 
https://github.com/django/django/blob/master/django/db/migrations/autodetector.py#L421

 I do have some concerns about dependencies. If the migration lives in the
 old app, the autodetector won't be able to detect that the next migration
 in the new app depends on the `RenameModel` migration in the old app.
 Likewise, if the migration lives in the new app, the next migration in the
 old app won't have a dependency on the migration that moves the model. The
 last case ''might'' not be a problem, but I can't say that off the top of
 my head.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.1863688fbb2bb6b7ec84c3584120968f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24686: Support for Moving a model between two Django apps

2015-04-22 Thread Django
#24686: Support for Moving a model between two Django apps
-+
 Reporter:  cancan101|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Migrations   |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by cancan101):

 I'm not sure how the plumbing works for migrations, but I would think the
 auto-detect logic would work like renaming of fields where if a model with
 the same name is deleted in one app and created in another the user is
 prompted with "did you move this model...".

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.39381c5bf6705be28b4f863be6664af4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24686: Support for Moving a model between two Django apps

2015-04-22 Thread Django
#24686: Support for Moving a model between two Django apps
-+
 Reporter:  cancan101|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Migrations   |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by timgraham):

 * needs_better_patch:   => 0
 * component:  Uncategorized => Migrations
 * needs_tests:   => 0
 * version:  1.8 => master
 * needs_docs:   => 1
 * stage:  Unreviewed => Accepted


Comment:

 Not sure about feasibility of detecting/auto-generating, but if not, we
 could certainly document the [http://stackoverflow.com/a/26472482/5112
 SeparateDatabaseAndState solution] in docs/howto/writing-migrations.txt.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.25e0034daa878e11339a0f697660eb48%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.