http://blog.philippmetzler.com/?p=52
Just tried django-ajax-filtered-fields and like it very much. I’m looking for a solution for this problem:
My model looks like this:
class Song(models.Model):
Album = models.ForeignKey(Album)
class Artist(models.Model):
album = models.ForeignKey(Album)
song = models.ForeignKey(So...
How do I allow fields to be populated by the user at the time of object creation ("add" page) and then made read-only when accessed at "change" page?
...
My model has a field of integer type representing timestamp in UTC. I would like that field to be displayed as DateField inside my form.
I'm using admin interface, i.e I have MyAdmin class inheriting from admin.ModelAdmin, which get passed into admin.site.register(...) function.
...
I have a custom list_display field which is responsible for a column of integers in one of my admin pages.
I need to allow staff members to sort according to it.
There's a solution for how to acheive that if the integer represents a count/average/etc of some DB field, which is not the case for me.
[ the solution for that case is here:...
i want to authenticate users using firstname and lastname
This is the code i am using
user = auth.authenticate(first_name=firstname,last_name=lastname,password=password)
it keep coming up with NoneType: None
i have checked the firstname and lastname plus password seen to be correct?
what i am doing wrong? thanks
...
It would be easy with a custom list_display, but that would cause me to lose the sorting ability according to that column.
...
I only you can limit what a user can do via the user permissions in admin.. But is there a way to limit them in admin via what group you add them to?
I want to allow a certain group to do everything in that model if they belong to a certain group
thanks!
...
I was hunting around the Internet for a way to easily allow users to blank out imagefield/filefields they have set in the admin.
I found this: http://www.djangosnippets.org/snippets/894/.
What was really interesting to me here was the code posted in the comment by rfugger:
remove_the_file = forms.BooleanField(required=False)
def save...
I have two MultiWidget one inside the other, but the problem is that the MultiWidget contained don't return compress, how do i do to get the right value from the first widget?
In this case from SplitTimeWidget
class SplitTimeWidget(forms.MultiWidget):
"""
Widget written to split widget into hours and minutes.
"""
def __i...
On AWS using Postgres, I do:
manage.py dumpdata
and the server just hangs. Any suggestions about what I should look for?
...
My first time with Django and StackOverflow so could do with a little help.
A Platform has many Categories and a Category can belong to many Platforms. A product belongs to one Platform and one or more of that Platforms Categories.
So this is what I have so far for my Models:
class Category(models.Model):
name = models.CharField(...
My question is very similar to this one: http://stackoverflow.com/questions/1057252/django-how-do-i-access-the-request-object-or-any-other-variable-in-a-forms-clea
Except, I have the same problem with admin form. So I can't see a way to init the form myself, therefore - to pass a request to it.
Thanks beforehand.
...
I'm having trouble getting django-admin.py to work... it's in this first location:
/Users/mycomp/bin/ but I think I need it in another location for the terminal to recognize it, no?
Noob, Please help. Thanks!!
my-computer:~/Django-1.1.1 mycomp$ sudo ln -s /Users/mycomp/bin/django-admin.py /Users/mycomp/django-1.1.1/django-admin.py
Pas...
I'm new to django, so please feel free to tell me if I'm doing this incorrectly. I am trying to create a django ordering system. My order model:
class Order(models.Model):
ordered_by = models.ForeignKey(User, limit_choices_to = {'groups__name': "Managers", 'is_active': 1})
in my admin ANY user can enter an order, but ordered_by mu...
Hello All,
I have a model 'Test' ,in which i have 2 foreignkey
models.py
class Test(models.Model):
id =models.Autofield(primary_key=True)
name=models.ForeignKey(model2)
login=models.ForeignKey(model1)
status=models.CharField(max_length=200)
class model1(models.Model):
id=models.CharField(primary_key=True)
.
...
When I run:
django-admin.py loaddata ../data/library_authors.json
the error is:
...
ValidationError: [u'Enter a valid date in YYYY-MM-DD format.']
The model:
class Writer(models.Model):
first = models.CharField(u'First Name', max_length=30)
other = models.CharField(u'Other Names', max_length=30, blank=True)
...
I have two models (ModelParent and ModelChild) with same m2m fields on Subject model.
ModelChild has a foreign key on ModelParent and ModelChild is defined as inline for ModelParent on admin page.
### models.py ###
class Subject(Models.Model):
pass
class ModelParent(models.Model):
subjects_parent = ManyToManyField(Subject)...
Hello!
I have two models:
class Account(models.Model):
main_request = models.ForeignKey('JournalistRequest', related_name='main_request')
key = models.CharField(_('Key'), max_length=100)
class JournalistRequest(models.Model):
account = models.ForeignKey(Account, blank=True, null=True)
When I try to delete a JournalistReq...
Hello ,
I am doing django admin internationalization .I am able to do it perfectly.But my concern is that in the address bar it is showing the app label in tranlated form which is not in us acii .Is this the problem with django or i m doing something wrong.
...
When Creating your own Admin Class for django.contrib.comments, I want to allow sorting of flagged comments. I can a custom method to the admin class that return comment.flags.count(), but not sure I get the admin to sort by this.
The problem I see is that its CommentFlag model that contains the foreign key to Comment model.
Anybody k...