I created my own Auth app, and now Admin is not working, what can you suggest?
Exception now is: 'User' object has no attribute 'is_authenticated'
I know my User really have no such method. So I have 2 ways:
- change admin
- adapt my user system
My question was: is there possibility to easily off admin bound to auth
...
Suppose there are two (or more) django administrators who have read a database record and then change and save it. There is no database problem, but some administrators are going to be surprised that the record they wrote was overwritten.
Is this issue ever addressed? One way would be to have an explicit "edit in progress" button which ...
I get the error in question when I attempt to create a project. I followed the instructions found at how to install python an django in windows vista.
...
I have an admin class which uses raw_id_fields. Instead of displaying the number key, I would like to convert that to the __unicode__ for the corresponding foreign key object.
I thought a way to do this would be to add a form to the admin class. This form would be one in which the field I want to change is overridden with my own widget...
How can i enable or disable actions according to the value of a field.For example In my model I have a status field which can have either of the value 'activate','pending','expired'.I am making a action which set the status equals to 'activate'.Know I want the action to be enable only if status is 'pending'.
...
how can i change the default filter choice from 'ALL'.I have a field named as 'status' which has three values :- 'activate','pending','rejected'.when i use list_filter in django_admin ,the filter is by default set to 'All' but i want to set it to pending by default.
...
I want to use the Django admin interface for a very simple web application but I can't get around a problem that should not be that hard to resolve ..
Consider the following:
class Contact(models.Model):
name = models.CharField(max_length=250, blank=False)
created_by = models.ForeignKey(User, blank=False)
I can't find a way t...
DECOM_CHOICES = (
('N', 'No'),
('Y', 'Yes'),
)
class Host(models.Model):
hostname = models.CharField(max_length=36, unique=True)
decommissioned = models.CharField(max_length=1, choices=DECOM_CHOICES, default='N')
ip_address = models.IPAddressField()
def __unicode__(self):
return self.hostname
class HostAdmi...
I'd like to be able to include a reference to the currently authenticated user with a Note when working with Notes from the admin interface. The model would look something like:
from django.db import models
from django.contrib.auth.models import User
from datetime import datetime
class Note(models.Model):
datetime = models.DateTi...
I have a model that has a field named "state":
class Foo(models.Model):
...
state = models.IntegerField(choices = STATES)
...
For every state, possible choices are a certain subset of all STATES. For example:
if foo.state == STATES.OPEN: #if foo is open, possible states are CLOSED, CANCELED
...
if foo.state == STA...
I have a status field which has 3 values: pending, activated
and rejected. If I am changing the value of status I want to
have a check that activated cannot be changed to pending. I
do not want to write stored-procs for this. Can I have the
previous value in Django before saving?
Means new and old value.
...
I am writing a action in django.I want to now about the rows which are updated by the action or say id field of the row.I want to make a log of all the actions.
I am having a field status which has 3 values :'activate','pending','reject'.I have made action for changing the status to activate.when i perform the action i want to have the ...
Given a model with ForeignKeyField (FKF) or ManyToManyField (MTMF) fields with a foreignkey to 'self' how can I prevent self (recursive) selection within the Django Admin (admin).
In short, it should be possible to prevent self (recursive) selection of a model instance in the admin. This applies when editing existing instances of a mod...
It gives you filter by staff status and superuser status, but what about groups?
...
I have an inline on a model with data with a fixed length, that has to be entered very fast, so I was thinking about a way of "tabbing" through fields automatically when the field is filled...
Could that be possible?
...
I've got a bunch of classes that inherit from a common base class. This common base class does some cleaning up in its delete method.
class Base(models.Model):
def delete(self):
print "foo"
class Child(Base):
def delete(self):
print "bar"
super(Child, self).delete()
When I call delete on the Child from...
on save if user select certain option i want to take user to a page where he can have one more field to be filled and then redirect to admin default page
...
I am having 2 models.i want to have model2 inline with model1 .On the admin page I want to show some fields of model 2 as a inlines and all of them as readonly.ALso when i click on the value of the inline i should link me to the model2 with that value
A inline that show fields readonly .I want to show inline model fields as readonly
...
I am having a status Field which has 3 options 1)activated 2)rejected 3)pending.If user select rejected status then he has to enter reason for rejection else that reason field should be hidden.Or when user choices rejected i should redirect it to some other form so that i can send email using the rejection reason
...
When an admin fieldset is given the class "collapse", it is rendered with a Show/Hide link installed by CollapsedFieldset.js which collapses or expands it.
In all cases where the collapse class appears, I'd like the link to be the whole fieldset box (or a div of that dimension) instead of just the word "Show".
What is the best way to "...