Skip to content

Commit

Permalink
Merge pull request #5719 from nyaruka/reorg_contacts_app
Browse files Browse the repository at this point in the history
Reorganize contacts app like orgs app with views as a package
  • Loading branch information
rowanseymour authored Nov 29, 2024
2 parents 36b6029 + f37bb76 commit e808754
Show file tree
Hide file tree
Showing 9 changed files with 2,042 additions and 2,024 deletions.
2,071 changes: 53 additions & 2,018 deletions temba/contacts/tests.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions temba/contacts/views/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .views import ContactCRUDL, ContactFieldCRUDL, ContactGroupCRUDL, ContactImportCRUDL # noqa
2 changes: 1 addition & 1 deletion temba/contacts/forms.py → temba/contacts/views/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from temba.utils import languages
from temba.utils.fields import InputWidget, SelectMultipleWidget, SelectWidget, TembaMultipleChoiceField

from .models import URN, Contact, ContactGroup, ContactURN
from ..models import URN, Contact, ContactGroup, ContactURN


class CreateContactForm(forms.ModelForm):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from temba import mailroom
from temba.utils.models.es import IDSliceQuerySet

from .models import Contact, ContactGroup, ContactGroupCount
from ..models import Contact, ContactGroup, ContactGroupCount

SEARCH_ALL_GROUPS = "g"
SEARCH_STATIC_GROUPS = "s"
Expand Down
1,982 changes: 1,982 additions & 0 deletions temba/contacts/views/tests.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion temba/contacts/views.py → temba/contacts/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
from temba.utils.models.es import IDSliceQuerySet
from temba.utils.views.mixins import ComponentFormMixin, ContextMenuMixin, ModalFormMixin, NonAtomicMixin, SpaMixin

from ..models import URN, Contact, ContactExport, ContactField, ContactGroup, ContactGroupCount, ContactImport
from .forms import ContactGroupForm, CreateContactForm, UpdateContactForm
from .models import URN, Contact, ContactExport, ContactField, ContactGroup, ContactGroupCount, ContactImport
from .omnibox import omnibox_query, omnibox_serialize

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion temba/triggers/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from temba.channels.models import Channel
from temba.contacts.models import ContactGroup
from temba.contacts.omnibox import omnibox_serialize
from temba.contacts.views.omnibox import omnibox_serialize
from temba.flows.models import Flow
from temba.schedules.models import Schedule
from temba.tests import CRUDLTestMixin, TembaTest
Expand Down
2 changes: 1 addition & 1 deletion temba/triggers/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from temba.channels.models import Channel
from temba.contacts.models import ContactURN
from temba.contacts.omnibox import omnibox_deserialize
from temba.contacts.views.omnibox import omnibox_deserialize
from temba.flows.models import Flow
from temba.schedules.views import ScheduleFormMixin
from temba.utils.fields import JSONField, OmniboxChoice, SelectWidget, TembaChoiceField
Expand Down
2 changes: 1 addition & 1 deletion temba/triggers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from temba.channels.models import Channel
from temba.channels.types.android import AndroidType
from temba.contacts.models import ContactGroup, ContactURN
from temba.contacts.omnibox import omnibox_serialize
from temba.contacts.views.omnibox import omnibox_serialize
from temba.flows.models import Flow
from temba.formax import FormaxMixin, FormaxSectionMixin
from temba.orgs.views.base import BaseListView, BaseMenuView
Expand Down

0 comments on commit e808754

Please sign in to comment.