I am using python with django i want redirect users to login page when he clicks back button after logout. How to achieve this? where to write the code?  To test whether django admin handles this..i logged into django admin..logged out and then hit b...
In my Django 1.2.4 site, I would like to direct the user to an admin page that is pre-filled out with some values, based on the current data they are working with. For example:  {% for person in people %}     <tr>         <td>{{person}}&l...
Here's part of my models.py:  class Person(models.Model):     birth_year = WideYear(null=True, blank=True)     birth_year_uncertain = models.BooleanField()     death_year = WideYear(null=True, blank=True)     death_year_uncertain = models.Boolean...
I'm trying to set a field default value based on other field selection that is foreign. Basically, these are the classes:  class Product(models.Model):         description = models.CharField('Description', max_length=200)         price =...
Ultimately, I'd like to include/exclude certain javascript file(s) based on... whatever.  Simply defining the Media class, by itself, won't work since that is only evaluated once.   I know I can do this by making a custom admin template, but...
Let's imagine we have those Django models:  class Band(models.Model):     name = models.CharField(max_length=256, default="Eagles of Death Metal")  class Song(models.Model):     band = models.ForeignKey(Band)   When using the admin to man...
I've built a django model where the required fields change based upon the user's selection on other previous fields. Specifically, it is an event scheduling application where the options change based on choices the user makes.  Some combinati...
In the django admin panel I currently have a DateField showing a nice Javascript calendar for inputting dates. However, I am only interested in the Month and Year. So I was wondering if it was possible to have the calendar only show the months and ye...
In our Django application, we rely on the contrib.Admin module for data entry.  Let's assume a simplified example like this. (the real use case is totally different, but would complicate the presentation without changing the question):  class Ban...
I'm looking for a way to autofill some fields in the admin, based on a selected field. I have a foreign key field in an Inline and want to show some data from the current selected object in the form in realtime.   A simplified version of my code...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.