Comments (5)
any help please?
from django-smart-selects.
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.
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:
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.
I don't have this error anymore, please close it.
from django-smart-selects.
I don't have this error anymore, please close it.
how
from django-smart-selects.
Related Issues (20)
- When I edit the form again, the contents of the chained appear empty HOT 3
- how to use django_export_import lib import django_smart_selects chainfileids?
- how to use smart-selects for a many to many field against a foreign key selection in django admin?
- Not working if primary key value of related object is 0 (zero) HOT 1
- Error with add new Inline form - ChainedForeignKey HOT 1
- ChainedManytoManyField not working with inline forms
- It doesn't work when I change the admin path HOT 3
- Actually doesnt support django version 4 HOT 11
- How to use it with pytest and create factories
- [idea] : Adding kw/arg 'display_model_col' to ChainedForeignKey et al.
- Option for removing already selected values in ChainedForeignKey field
- Django smart selects doesn't work with JS cloning
- Empty results when accessing field in `chained_field`. HOT 5
- ChainedSelectMultiple doesn't update de css extra attrs
- Chaining not working in inlines in ChainedManyToManyField with horizontal=True parameter HOT 1
- Cannot set queryset for Chainedforeignkey
- ChainedModelChoiceField.choices initialization incompatibility with Django 5.0 HOT 10
- Publish latest package version to PyPi HOT 3
- Empty dropdown for chained field HOT 1
- jQuery URL docs is misleading and not aligned with that is actually done
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-smart-selects.