-
-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with inlines in admin #150
Comments
Did you use latest version of django-smart-selects from PyPI? |
django-smart-selects-1.2.3 |
Please post the exact error from Django, the complete traceback, the problematic |
No errors, does not js do it when i try add new StackedInline |
Does anything appear in your web browser's development console? |
Nothing happens Ajax request does not work,when add new StackedInline or TabularInline |
Yes,empty console |
Please post the relveant excerpts of the problematic |
models class ProviderGames(models.Model):
class Meta():
db_table = 'providers'
verbose_name = 'Provider'
verbose_name_plural = 'Provider'
def __unicode__(self):
return format('%s' % self.title)
title = models.CharField(max_length=255,verbose_name='Name Provider)
class Games(models.Model):
class Meta():
db_table = 'games'
verbose_name = 'Games'
verbose_name_plural = 'Games'
def __unicode__(self):
return format('%s' % self.title)
title = models.CharField(max_length=255,verbose_name='Название Игры')
photo = models.ImageField(upload_to='games_logo', verbose_name='Лого Игры')
count_lines = models.CharField(max_length=255,verbose_name='Количество Линий')
count_barabans = models.CharField(max_length=255,verbose_name='Количество Барабанов')
rtp = models.CharField(max_length=255,verbose_name='RTP')
provider = models.ForeignKey(ProviderGames,verbose_name='Провайдер')
class Casino(models.Model):
class Meta():
db_table = 'casino'
verbose_name = 'Казино'
verbose_name_plural = 'Казино'
def __unicode__(self):
return format('%s' % self.title)
title = models.CharField(max_length=255,verbose_name='Название Казино')
alias = models.SlugField(max_length=255)
logo = models.ImageField(upload_to='casino_logo',verbose_name='Лого казино')
background = models.ImageField(upload_to='casino_back',verbose_name='Подложка казино')
e_wallet = models.CharField(max_length=255,verbose_name='E-wallet')
e_partomone = models.CharField(max_length=255,verbose_name='Чеки')
credit_cards = models.CharField(max_length=255,verbose_name='Credit/Debit карты')
bank_send = models.CharField(max_length=255,verbose_name='Банковский перевод')
pending_period = models.CharField(max_length=255,verbose_name='Период выплаты')
raiting_total = models.IntegerField(verbose_name='Общий рейтинг')
raiting_admin = models.DecimalField(max_length=2,max_digits=2, decimal_places=1, verbose_name='Рейтинг Администратора')
external_href = models.CharField(max_length=255,verbose_name='Адрес казино')
description = models.CharField(max_length=1000,verbose_name='Описание казино')
description_bonus = models.CharField(max_length=1000, verbose_name='Описание бонусов')
support = models.CharField(max_length=1,choices=SUPPORT,verbose_name='Поддержка')
payment = models.ManyToManyField(CasinoPayment, verbose_name='Платежные системы')
valuta = models.ManyToManyField(CasinoValuta, verbose_name='Валюта')
langs = models.ManyToManyField(CasinoLang,verbose_name='Языки')
def save(self, *args,**kwargs):
tr = dict([(ord(a), ord(b)) for (a, b) in zip(*SYMBOLS)])
title = self.title
title_exists = Casino.objects.filter(alias=title.translate(tr)).exclude(pk=self.pk).count()
if title_exists > 0:
title = '%s_%s' % (self.title, title_exists)
self.alias = slugify(title.translate(tr))
super(Casino, self).save(*args, **kwargs)
class ProvidersAndGames(models.Model):
class Meta():
db_table = 'providers_and_games'
verbose_name = 'P&G'
verbose_name_plural = 'P&G'
def __unicode__(self):
return format('%s' % self.casino)
providers = models.ForeignKey(ProviderGames)
games = ChainedManyToManyField(Games,chained_field="providers",
chained_model_field="provider")
casino = models.ForeignKey(Casino) admin class AdminPandG(admin.StackedInline):
model = ProvidersAndGames
extra = 1
class AdminCasino(admin.ModelAdmin):
inlines = [AdminPandG]
admin.site.register(Casino,AdminCasino) Edit (by blag): Added syntax highlighting to code blocks |
This is problem |
@millin: You mind taking a look into this? |
I sent the problem clearly, when i try add new Line chained js not working, help me PLEASE |
@VicDate: It would be helpful if you could debug a big and test the results, but I'm curious if @millin can reproduce the issue. He's the author of PR #148 - the one that fixed admin inlines - so he would have the easiest time reproducing this, fixing it, and adding a test case for it. I also don't have a lot of time today to delve into this, but I should later in the week. @VicDate: Bump this thread in a few days if we don't get back to you. |
@blag When going you to release the new version? |
@SalahAdDin I'm a little confused by your question, I released version 1.2.4 five months ago in October as per my last comment. Since then I've released a few more versions - we're up to version 1.3.4 now! I did remove versions < 1.3.3 (including 1.2.4) from PyPI and GitHub because they contained an XSS flaw. Please upgrade to a secure and supported version as soon as possible. If you absolutely need to use the (insecure) code as it was in version 1.2.4 you can dig through the commit history and tell If you would like to help out, perhaps by becoming a release manager for this project, feel free to email @digi604 and ask for PyPI access. Thanks! |
Good day i have bug with "admin.StackedInline", don't work with add new line, use Django 1.10
The text was updated successfully, but these errors were encountered: