Django with 2 subapps with same name

59 views
Skip to first unread message

Valder Gallo

unread,
May 10, 2013, 2:19:46 PM5/10/13
to django...@googlegroups.com
I cant have 2 subapp with same name in Django ? 

Ex. 

invoice/sony 
invoice/samsung

storage/sony
storage/samsung

 

Thiago Avelino

unread,
May 10, 2013, 3:08:21 PM5/10/13
to django...@googlegroups.com
Yep, add in installed_app:

application_name.storage.sony
application_name.storage.samsung




Cheers,
Thiago Avelino


--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Valder Gallo

unread,
May 10, 2013, 3:22:54 PM5/10/13
to django...@googlegroups.com
Nops ... when i used 

 INSTALLED_APP = { 
  'invoice.sony',
  'invoice.samsung',
  'storage.sony',
  'storage.samsung',  
}

storage.samsung.models is overrind invoice.samsung.models

:(


--
Valder Gallo
+55 11 9949 2911
+55 11 2532 2911
Skype: valdergallo
@valdergallo

Shawn Milochik

unread,
May 10, 2013, 3:31:34 PM5/10/13
to django...@googlegroups.com

Valder Gallo

unread,
May 10, 2013, 3:43:47 PM5/10/13
to django...@googlegroups.com
tnx :D


On Fri, May 10, 2013 at 4:31 PM, Shawn Milochik <sh...@milochik.com> wrote:

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Andre Terra

unread,
May 10, 2013, 6:46:52 PM5/10/13
to django...@googlegroups.com
Granted this structure doesn't seem reasonable. Each manufacturer shouldn't be a separate app, but rather "backends" to generic storage or invoice apps.

So you only need 
INSTALLED_APPS = (
    # ...
    'storage',
    'invoice'
)

And then work from there. The apps themselves should be able to register and handle different backends. Take a look at what django-registration[1] does!

Cheers,
AT

Tom Evans

unread,
May 13, 2013, 11:02:21 AM5/13/13
to django...@googlegroups.com
On Fri, May 10, 2013 at 8:22 PM, Valder Gallo <valde...@gmail.com> wrote:
> Nops ... when i used
>
> INSTALLED_APP = {
> 'invoice.sony',
> 'invoice.samsung',
> 'storage.sony',
> 'storage.samsung',
> }
>
> storage.samsung.models is overrind invoice.samsung.models
>
> :(
>

Does it help if they have distinct app_labels?

https://docs.djangoproject.com/en/1.5/ref/models/options/#app-label

Cheers

Tom

Andre Terra

unread,
May 15, 2013, 5:27:39 PM5/15/13
to django...@googlegroups.com
Despite possibly working with different app_labels, I believe the point still stands that if the storage and invoice apps share a lot of functionality among vendors, they should just be 'invoice' and 'storage' and allow for pluggable companies.


Cheers,
AT
Reply all
Reply to author
Forward
0 new messages