Django

Code

Ticket #4639 (closed: duplicate)

Opened 1 year ago

Last modified 10 months ago

unique_together and edit_inline, IntegrityError instead of suitable error message

Reported by: Reza Mohammadi <reza@zeerak.ir> Assigned to: adrian
Milestone: Component: Admin interface
Version: 0.96 Keywords:
Cc: jshaffer2112@gmail.com Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

models:

class TranslatableString(models.Model):
    title = models.CharField(_('Title'), maxlength=200)
    class Admin:
        pass
        
class TranslationString(models.Model):
    main = models.ForeignKey(TranslatableString,verbose_name=_("Translation of string"),
                             edit_inline=models.STACKED)
    lang = models.ForeignKey(Language, core=True)
    translation = models.CharField(_('Translation'), maxlength=200)
    ...

I'm adding/editing TranslatableString, and when I enter two TranslationStrings with same lang, I see this server error:

IntegrityError at /admin/i18n/translatablestring/1/

columns main_id, lang_id are not unique

But I excepted some suitable error message in red!

Attachments

Change History

07/04/07 18:16:07 changed by John Shaffer <jshaffer2112@gmail.com>

  • cc set to jshaffer2112@gmail.com.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

08/30/07 22:40:56 changed by Simon G. <dev@simon.net.nz>

Duplicate of #565

09/07/07 12:06:29 changed by Brian Rosner <brosner@gmail.com>

  • status changed from new to closed.
  • resolution set to duplicate.

Simon, I believe you meant to close this. I am closing it now.


Add/Change #4639 (unique_together and edit_inline, IntegrityError instead of suitable error message)




Change Properties
Action