Just letting you know that, I've read msg and reviewed you code. Although these are interview objects, it uses word tokens. Key words such as those used in this code are handled well by utilizing Natural Language Processing (NLP) methods. Mapping and Regular Expressions (Regex) do alot of the work in Python, R, React JavaScript etc. Now I need to see if Turbo Pascal supports these libraries of code. If it's okay, maybe Tomorrow or Thurs will work as far as meeting is concerned.
On Mon, Mar 25, 2019 at 7:07 PM Keegen Knapp <keeg...@gmail.com> wrote: > I'm trying to write a custom app where you can add new plants in the > admin. Then create a list view, category view and detailed view. You can > see my error and code below. Any help is greatly appreciated!! > > Error - > > [image: Screen Shot 2019-03-25 at 11.25.09 AM.png] > > > models.py - > > from django.db import models > from cms.models.fields import PlaceholderField > from django.db.models.signals import pre_save > > #create a basic species model > class Species(models.Model): > name = models.CharField(max_length=50, unique=True) > def __unicode__(self): > return self.name > > class Plant(models.Model): > name = models.CharField(max_length=50, unique=True) > #textfield to choose season > season = models.TextField() > #automatically adds a created date, good for ordering plants by dates etc > pub_date = models.DateField(auto_now_add=True) > #automatically adds slug, requires Auto slug > slug = models.SlugField(max_length=70, unique=True) > #FK's to a species model > species = models.ForeignKey(Species) > #life cycle > life_cycle = models.CharField(max_length=60) > #add a upload section for specification sheets > position = models.TextField() > #take advantage of the CMS's placeholders for images, much more flexible > than file_upload > image = PlaceholderField('plant_images', related_name="image") > #again description, take advantage of the CMS capabilities. > description = PlaceholderField('plant_description', > related_name="description") > > > *views.py* > > from django.shortcuts import render_to_response > from django.template import RequestContext > > class ProductDetailView(DetailView): > model = Plant > template_name = 'plants/detail.html' > > > *urls.py* > from plants.views import PlantDetailView > > urlpatterns = patterns('plants.views', > url(r'^(?P<slug>[\w-]+)/$', PlantDetailView.as_view()), > ) > > > *cms.app.py <http://cms.app.py/> -* > > from cms.app_base import CMSApp > from cms.apphook_pool import apphook_pool > from django.utils.translation import ugettext_lazy as _ > > class PlantsApp(CMSApp): > name = _("Plants") # give your app a name, this is required > urls = ["plants.urls"] # link your app to url configuration(s) > > def get_urls(self, page=None, language=None, **kwargs): > return ["plants.urls"] > > apphook_pool.register(PlantsApp) # register your app > > *apps.py - * > class PlantsConfig(AppConfig): > name = 'plants' > verbosename = "Plants" > > *admin.py - * > from django.contrib import admin > from .models import Plant, Species > from aldryn_apphooks_config.admin import ModelAppHookConfig, > BaseAppHookConfig > > class PlantAdmin(ModelAppHookConfig, admin.ModelAdmin): > search_fields = ['name'] > readonly_fields = ['slug'] > ordering = ['name'] > pass > admin.site.register(Plant, PlantAdmin) > > > class SpeciesAdmin(admin.ModelAdmin): > search_fields = ['name'] > ordering = ['name'] > pass > admin.site.register(Species, SpeciesAdmin) > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/f5c0d1e5-3962-48ce-8fdc-a082c37ddba5%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/f5c0d1e5-3962-48ce-8fdc-a082c37ddba5%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFJtDQf74MfjjJmdba8sdp7vgkMNDRp5251Xgrz0_o_0z03Fyw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.