GithubHelp home page GithubHelp logo

Comments (5)

drlinux avatar drlinux commented on August 16, 2024

any help please?

from django-smart-selects.

drlinux avatar drlinux commented on August 16, 2024

Please next time if you write something don't give it. Because who uses this plugin also waiting a support. No support, sucks!

from django-smart-selects.

SalahAdDin avatar SalahAdDin commented on August 16, 2024

I have this error too.
I would put a report that problem, but it seems no help.
Well, i will put.

Here too.

My code in models is :

#Model
class Person(models.Model):
    name = models.CharField(max_length=20, help_text="Tipo de Persona que se inscribe", verbose_name="Nombre del Tipo")

    class Meta:
        verbose_name = "Tipo de Persona"

    def __str__(self):
        return self.name

class MemberShip(models.Model):
    title = models.CharField(max_length=255, help_text="Nombre del tipo de afiliación.",verbose_name="Título")
    #type_person = models.CharField(max_length=255, choices=AFFILIATION_PERSON_TYPE, verbose_name='Tipo de Persona',)
    type_person = models.ForeignKey(Person, verbose_name="Tipo de Persona", related_name="membership")
    descript = models.CharField(max_length=500, help_text="Descripción del tipo de afiliación.", verbose_name="Descripción")
    value = models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Cuota', help_text="Cuota de afiliación.")

    class Meta:
        #description = 'Modelo Membresía'
        verbose_name = "Membresía"

    def __str__(self):
        return self.title

#Afiliacion
class Affilliation(models.Model):
    person = models.ForeignKey(Person, verbose_name="Tipo de Persona", related_name="persona")
    affiliation = ChainedForeignKey(
        MemberShip,
        chained_field="persona",
        chained_model_field="name",
        show_all=False,
        auto_choose=True,
        verbose_name='Membresía',
        #related_name='affiliation'
    )

And my admin code is very simple:

class AffilliationAdmin(admin.ModelAdmin):
    fieldsets = [
        ('Afiliación', {
            'fields': ['person', 'affiliation', 'affiliates', 'is_active'],
        }),
        ('Fechas', {
            'fields': ['date_in', 'date_renew'],
        }),
    ]
    list_display = ('affiliation', 'affiliates', 'is_active', 'date_prein', 'date_in', 'date_renew', 'date_end')
    list_filter = ('affiliation', 'affiliates', 'is_active')
    list_editable = ('affiliation',)
    search_fields = ('affiliation', 'affiliates', 'is_active', 'date_in',)

    def date_end(self):
        return self.date_in + timedelta(days=365)

    date_end.short_description = "Fecha de Expiración"
    date_end.allow_tags = True

admin.site.register(Affilliation, AffilliationAdmin)

As you can see all is well, but, if i try use ChainedField, well, in the django-admin i give this:
problemasconsmarts

In Juridica i have four MemberShips child's, but in this select box they aren't.

In a form this field works?

from django-smart-selects.

SalahAdDin avatar SalahAdDin commented on August 16, 2024

I don't have this error anymore, please close it.

from django-smart-selects.

apurvpatel2121 avatar apurvpatel2121 commented on August 16, 2024

I don't have this error anymore, please close it.
how

from django-smart-selects.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.