Re: Bug in admin models?

2013-10-25 Thread Sandro Dutra
Sorry, I didn't see the django.contrib.admin. You're overrriding the add method for you model? Because it's appear the add method is returning None: Exception Type: TypeError at /admin/myapp/mymodel/add/ Exception Value: 'NoneType' object has no attribute '__getitem__' 2013/10/25 Derek > Yes,

Re: Bug in admin models?

2013-10-25 Thread Derek
Yes, I simplified the names in the installed list and traceback, and as result probably altered the correct grammer slighlty ... but I am hoping that someone who understand the "innards" of the Django admin can point what is _actually_ wrong; given that the error trace is not actually referenci

Re: Bug in admin models?

2013-10-24 Thread Nigel Legg
In installed apps you have s2.myapp, the traceback is just myapp. Also you have 's2.myapp, in the installed_apps, should it not be 's2.myapp', (ie missing the end quote)? Cheers, Nigel 07914 740972 On 24 October 2013 14:20, Derek wrote: > Yes, its there - the line after 'suit'. > > > On Wed

Re: Bug in admin models?

2013-10-24 Thread Derek
Yes, its there - the line after 'suit'. On Wednesday, 23 October 2013 19:22:54 UTC+2, Odin wrote: > > Can't see the django.contrib.admin in INSTALLED_APPS. > > > 2013/10/23 Derek > > >> I am trying to add a model entry, via the admin; I get this error (which >> has not happened before), running D

Re: Bug in admin models?

2013-10-23 Thread Sandro Dutra
Can't see the django.contrib.admin in INSTALLED_APPS. 2013/10/23 Derek > I am trying to add a model entry, via the admin; I get this error (which > has not happened before), running Django on Ubuntu 12.04 with the test > server. Not sure if there is an error with the model (which has worked >

Bug in admin models?

2013-10-23 Thread Derek
I am trying to add a model entry, via the admin; I get this error (which has not happened before), running Django on Ubuntu 12.04 with the test server. Not sure if there is an error with the model (which has worked fine up to now) or ...? Request Method: POST Request URL: http://127.0.0.1:8000/a

Re: Get request.user outside of [admin|models|views].py

2012-05-13 Thread Alireza Savand
Also i found https://github.com/seveas/django-echelon very usefull Specially *CurrentUserFiled* For the information, use shoulda be always authenticated so it's not a case here! Thank you On Sun, May 13, 2012 at 6:27 PM, Rafał Stożek wrote: > It is possible using simple middleware and > http://d

Re: Get request.user outside of [admin|models|views].py

2012-05-13 Thread Rafał Stożek
It is possible using simple middleware and http://docs.python.org/library/threading.html#threading.local class. But note that code doesn't have to always be called from HTTP - it means that you must handle situation where user is not known. Examples: http://djangosnippets.org/snippets/2179/ htt

Get request.user outside of [admin|models|views].py

2012-05-13 Thread Alireza Savand
Hi Let me explain it. i developing and app to trace the models activity, hmmm. actualy it's reversioning app for other models. As a reversioning model shoulda store user_id. What i'm trying to do is to connect those models post_save signal to create a reversion on each changes. But i don't want

Need advice on admin models

2012-03-19 Thread django_noob
Hello all, I am just starting learning Django and managed to get a basic website working with a nice admin section. I am now facing a problem which I am not sure how to resolve. So I basically have 2 tables in my database: - Flat - PendingFlat The PendingFlat would be a subset of the Flat

Re: weird problem with django admin models and webfaction

2010-02-22 Thread Simon Davies
Duh!! yeah restarting apache did it. How did I forget something so simple!! Thanks Simon On 22 Feb, 15:04, Shawn Milochik wrote: > Did you manually restart the Apache instance for this app? > > I had a similar problem, and it turned out that I had a bit of code in one of > my model that was

Re: weird problem with django admin models and webfaction

2010-02-22 Thread Shawn Milochik
Did you manually restart the Apache instance for this app? I had a similar problem, and it turned out that I had a bit of code in one of my model that was pulling from a table that was no longer defined. Check for that as well. -- You received this message because you are subscribed to the Go

weird problem with django admin models and webfaction

2010-02-22 Thread Simon Davies
Hi I'm still developing my app and I have just refactored my models in my django app. I dropped most of the existing tables on my local dev machine and then completely rebuilt everything using syncdb, everything worked fine, including the admin, no probs at all. Then I updated everything on my w

Re: custom permission in admin models

2009-10-06 Thread Bogdan I. Bursuc
Ok, I think your answer is here on creating permissions: http://docs.djangoproject.com/en/dev/topics/auth/#id1 in the ModelAdmin, override the `save_model` method and check the current user permission: request.user.has_perm('permission_name') for more on checking permission see thi

Re: custom permission in admin models

2009-10-06 Thread elminio
not exactly, for example I want to make custom permission which enables user to change one field in model but only to 5 letter length word while other users may change that field to 6 letters length word. Thats sily example but in some cases it may be useful. On Oct 6, 10:19 am, "Bogdan I. Bursu

Re: custom permission in admin models

2009-10-06 Thread Bogdan I. Bursuc
i think you want to create a group. On Tue, 2009-10-06 at 01:05 -0700, elminio wrote: > Hi, > In admin Panel I can choose groups and give them specified > permissions. For example > > admin | log entry | can add log entry > > And I would like to create my own type of permission which for exampl

custom permission in admin models

2009-10-06 Thread elminio
Hi, In admin Panel I can choose groups and give them specified permissions. For example admin | log entry | can add log entry And I would like to create my own type of permission which for example is called all and gives to the specified user permission to do whatever he likes, and other permiss

Re: Converting .96 to 1.0 How to admin models?

2008-09-26 Thread Lance F. Squire
On Sep 26, 1:53 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > > # relative import is simpler and safer > import models > > # using introspection > from django.db.models import Model > for name in dir(models): > obj = getattr(models, name) > if obj is not Model and issubclass(obj,

Re: Converting .96 to 1.0 How to admin models?

2008-09-26 Thread bruno desthuilliers
On 26 sep, 18:07, "Lance F. Squire" <[EMAIL PROTECTED]> wrote: > Converting a .96 site I was working on to the 1.0 set-up. > > Is there a quick way to list all my models in the admin? > > Or do I have to : > > from HCVGM.systems.models import System > > admin.site.register(System) > > for every on

Converting .96 to 1.0 How to admin models?

2008-09-26 Thread Lance F. Squire
Converting a .96 site I was working on to the 1.0 set-up. Is there a quick way to list all my models in the admin? Or do I have to : from HCVGM.systems.models import System admin.site.register(System) for every one? b.t.w. I presume the class Admin: pass in the Models.py is

Re: problems updating admin / models to 1.0

2008-09-04 Thread Rajesh Dhawan
> > However, when I try to go to the admin I get either one of two errors > (if I keep refreshing, the errors change between the two randomly. > > Either > --- > TypeError at /admin/ > > dict objects are unhashable It seems that one of your errors is in books/data/admin.py and not in the adm

Re: problems updating admin / models to 1.0

2008-09-04 Thread Mike Chambers
fyi I think I tracked this down. I had this Admin def: -- class BookVersionAdmin(admin.ModelAdmin): fields = ( ("Book", {'fields':('title', 'book', 'language', 'version', 'license', 'is_release', 'is_public')}), ("Contributors", {'fields':('authors', 'con

problems updating admin / models to 1.0

2008-09-04 Thread Mike Chambers
I am working on migrating an Django app to 1.0. I am running into problems getting my models registered with the admin. I am following the info here: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Mergednewforms-adminintotrunk I have updated my main urls.py: - from dja

Re: Admin & Models

2007-08-02 Thread Rohit
Thanks Nathan. I think this solves one part of my problem. Also just for reference, the method should be modified as so: def company(self): return self.sub_dept.dept.company and so on. The exclusion of self, leads Django to look for a global named "sub_dept". Any idea how I can add company to

Re: Admin & Models

2007-08-02 Thread Nis Jørgensen
Nathan Ostgard skrev: > list_display can use functions as their value... so, you can have: > > class Employee(models.Model): > sub_dept = ForeignKey(SubDept) > > def company(self): > return sub_dept.dept.company > > def dept(self): > return sub_dept.dept > > class Admin: > list

Re: Admin & Models

2007-08-02 Thread Nathan Ostgard
list_display can use functions as their value... so, you can have: class Employee(models.Model): sub_dept = ForeignKey(SubDept) def company(self): return sub_dept.dept.company def dept(self): return sub_dept.dept class Admin: list_display = ('first_name, 'last_name', 'compa

Admin & Models

2007-08-01 Thread Rohit
Actually my question is two fold, most likely due to brain farts on my end. I'm relatively a newbie to Django, so please bear with me. Here's my scenario. I have this for my relationships: Company->Dept->Sub-Dept->Employees->Roles "->" represents a one-to-many relationship. Problem #1: If I do