I should have tried before I typed.

I made the admin.py , and a MultiColorProductAdmin class. Still, I get
404.


On Aug 19, 9:23 am, Lagg <[email protected]> wrote:
> I think I'm making this way harder than it needs to be.
>
> the admin url for 'configurable products' on my site is
>
> admin/product/configurableproduct/
>
> but
>
> admin/product/multicolorproduct returns 404
>
> I can interact with multicolorproduct via manage.py shell, so at least
> that part is working.
>
> how exactly should I have "register it with the admin"  ? Make a file
> called admin.py and put in "admin.site.register(MultiColorProduct)" ?
>
> Do I need to make a MultiColorProductAdmin(admin.ModelAdmin)
> class ?
>
> Thanks for all of the help, I'm sure the internet is doing a
> collective eyeball roll at my antics.
>
> On Aug 19, 7:49 am, Bob Waycott <[email protected]> wrote:
>
> > When you extend Product as you did with your MultiColorProduct, it does not
> > show up in options.
> > You register it with the admin, and interact with it as you normally would
> > the Product model.
>
> > e.g., go to /admin/store/multicolorproduct
>
> > Or whatever the url would be for your app structure.
>
> > On Tue, Aug 18, 2009 at 6:08 PM, Lagg <[email protected]> wrote:
>
> > > Read through it and cooked up something crazy simple (I see the
> > > advantages to extending Product)
>
> > > made a new app called multicolor
>
> > > multicolor/models.py
> > > --------------------------
> > > from django.db import models
> > > from django.utils.translation import ugettext_lazy as _
> > > from product.models import Product, ProductManager
> > > from satchmo_utils.thumbnail.field import ImageWithThumbnailField
>
> > > class MultiColorProduct(Product):
> > >    objects = ProductManager()
>
> > >    def __unicode__(self):
> > >        return u'%s' % self.name
>
> > >    class Meta:
> > >        verbose_name = _('MultiColor Product')
> > >        verbose_name_plural = _('MultiColor Products')
>
> > > -----------------------------------
>
> > > I tried looking at the product options and seeing if "Multicolor
> > > Product" was amoung the list, but I didn't see anything.  (Tried it
> > > with adding store.multicolor to INSTALLED_APPS and without)
>
> > > I'm starting to think I have a bigger problem, and that something
> > > inside my settings.py is messed up.
>
> > > Settings.py
> > > ----------------------------------------------------
>
> > > # Django settings for store project.
> > > import os
> > > DIRNAME = os.path.abspath(os.path.dirname(__file__))
> > > LOCAL_DEV = False
>
> > > DEBUG = True
> > > TEMPLATE_DEBUG = DEBUG
>
> > > ADMINS = (
> > >    # ('Your Name', '[email protected]'),
> > > )
>
> > > MANAGERS = ADMINS
>
> > > DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2',
> > > 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> > > DATABASE_NAME = os.path.join(DIRNAME,'database.db')             # Or
> > > path to database file if using sqlite3.
> > > DATABASE_USER = ''             # Not used with sqlite3.
> > > DATABASE_PASSWORD = ''         # Not used with sqlite3.
> > > DATABASE_HOST = ''             # Set to empty string for localhost.
> > > Not used with sqlite3.
> > > DATABASE_PORT = ''             # Set to empty string for default. Not
> > > used with sqlite3.
>
> > > # Local time zone for this installation. Choices can be found here:
> > > #http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> > > # although not all choices may be available on all operating systems.
> > > # If running in a Windows environment this must be set to the same as
> > > your
> > > # system time zone.
> > > TIME_ZONE = 'America/Chicago'
>
> > > # Language code for this installation. All choices can be found here:
> > > #http://www.i18nguy.com/unicode/language-identifiers.html
> > > LANGUAGE_CODE = 'en-us'
>
> > > SITE_ID = 1
>
> > > # If you set this to False, Django will make some optimizations so as
> > > not
> > > # to load the internationalization machinery.
> > > USE_I18N = True
>
> > > # Absolute path to the directory that holds media.
> > > # Example: "/home/media/media.lawrence.com/"
> > > MEDIA_ROOT = os.path.join(DIRNAME, 'static/')
>
> > > # URL that handles the media served from MEDIA_ROOT. Make sure to use
> > > a
> > > # trailing slash if there is a path component (optional in other
> > > cases).
> > > # Examples: "http://media.lawrence.com";, "http://example.com/media/";
> > > MEDIA_URL = 'this works fine so I'm not worried about it'
>
> > > # URL prefix for admin media -- CSS, JavaScript and images. Make sure
> > > to use a
> > > # trailing slash.
> > > # Examples: "http://foo.com/media/";, "/media/".
> > > ADMIN_MEDIA_PREFIX = '/media/'
>
> > > # Make this unique, and don't share it with anybody.
> > > SECRET_KEY = 'actual secret key'
>
> > > # List of callables that know how to import templates from various
> > > sources.
> > > TEMPLATE_LOADERS = (
> > >    'django.template.loaders.filesystem.load_template_source',
> > >    'django.template.loaders.app_directories.load_template_source',
> > > #     'django.template.loaders.eggs.load_template_source',
> > > )
>
> > > MIDDLEWARE_CLASSES = (
> > >    'django.middleware.common.CommonMiddleware',
> > >    'django.contrib.sessions.middleware.SessionMiddleware',
> > >    'django.contrib.auth.middleware.AuthenticationMiddleware',
> > >    'django.middleware.doc.XViewMiddleware',
> > >    'threaded_multihost.middleware.ThreadLocalMiddleware',
> > >    'satchmo_store.shop.SSLMiddleware.SSLRedirect',
> > > )
>
> > > ROOT_URLCONF = 'store.urls'
>
> > > TEMPLATE_DIRS = (This works fine, so I know it's right)
>
> > > TEMPLATE_CONTEXT_PROCESSORS = (
> > >    'satchmo_store.shop.context_processors.settings',
> > >    'django.core.context_processors.auth',
> > >     )
>
> > > INSTALLED_APPS = (
> > >    'django.contrib.sites',
> > >    'satchmo_store.shop',
> > >    'django.contrib.admin',
> > >    'django.contrib.auth',
> > >    'django.contrib.contenttypes',
> > >    'django.contrib.comments',
> > >    'django.contrib.sessions',
> > >    'django.contrib.sitemaps',
> > >    'registration',
> > >    'keyedcache',
> > >    'livesettings',
> > >    'l10n',
> > >    'sorl.thumbnail',
> > >    'satchmo_store.contact',
> > >    'tax',
> > >    'tax.modules.no',
> > >    'tax.modules.area',
> > >    'tax.modules.percent',
> > >    'shipping',
> > >    'product',
> > >    'payment',
> > >    'payment.modules.giftcertificate',
> > >    'satchmo_utils',
> > >    'app_plugins',
> > >     'store.custom_products',
> > >    'store.multicolor',
> > >    )
>
> > > AUTHENTICATION_BACKENDS = (
> > >    'satchmo_store.accounts.email-auth.EmailBackend',
> > >    'django.contrib.auth.backends.ModelBackend'
> > >         )
>
> > > #### Satchmo unique variables ####
> > > #from django.conf.urls.defaults import patterns, include
> > > SATCHMO_SETTINGS = {
> > >    'SHOP_BASE' : '',
> > >    'MULTISHOP' : False,
> > >      #'SHOP_URLS' : patterns('satchmo_store.shop.views',)
> > >    }
>
> > > # Load the local settings
> > > from local_settings import *
>
> > > ------------------------------------------------------
>
> > > On Aug 18, 12:12 pm, Bob Waycott <[email protected]> wrote:
> > > > My method doesn't require much "hooking up" of anything other than admin
> > > > site registration.
> > > > Take a look at Part One. It's pretty easy to digest, I think.
>
> > > > Let me know if you have any questions afterward.
>
> > > > Best,
>
> > > > Bob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to