Re: Forms admin
On Thu, Mar 5, 2015 at 6:49 PM, Aurélio Moreirawrote: > Hello guys , I 'm building a system in Django and is my first contact with > the language , enjoyed the admin, but my tables have many, many fields even > , I would like to know the following : Are you like me to change the output > of forms ? I would like to control the layout of the form of each module , > it is possible? Hi, Give a look to https://github.com/maraujop/django-crispy-forms -- Julien Castets -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADF714a4-%2BRCAHQSd9JmmkOFjKv08K5oc9gfwwFzK5JEz4nA4Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Forms admin
Hello guys , I 'm building a system in Django and is my first contact with the language , enjoyed the admin, but my tables have many, many fields even , I would like to know the following : Are you like me to change the output of forms ? I would like to control the layout of the form of each module , it is possible? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8f444302-dd6f-47b0-98d6-f03c27fefac2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: You don't have permission to edit anything - new forms admin
Are you using a custom authentication backend? Admin calls get_all_permissions() method on the logged-in user, which tries to call get_all_permissions() method of each authentication backend used. The back-ends used should implement this method and definetely http://docs.djangoproject.com/en/dev/topics/auth/#other-authentication-sources should mention that. Best, oMat On Mar 12, 4:28 pm, dave <david.mic...@gmail.com> wrote: > Hi, > I'm encountering exactly the same problem as yours. Didyoufinally > find the solutions? > Thanks, > Dave > > On Feb 17, 1:25 pm, Tipan <t...@ortengo.co.uk> wrote: > > > I'm having some problems with the New Forms Admin that are giving me > > the error message "Youdon'thavepermissiontoeditanything." when > > I log into the Admin. I also lose the admin-media so that the page > > displays on a plain white background. > > > I'm using the latest django release from the trunk r9844. > > > Interestingly, Ihaveanother app that uses exactly the same database > > and this delivers full access for the same user (a superuser). > > > I've checked through the urls/settings and admin.py files and both are > > identical except for the app name. > > > On previous threads it suggests putting print statements in contrib > > \admin\__init__.py to check the apps loaded by autodiscover and it > > seems to be working as expected: > > django.contrib.auth > > django.contrib.contenttypes > > django.contrib.sessions > > django.contrib.admin > > django.contrib.humanize > > django.contrib.flatpages > > hive.promotions > > > where hive is my app. > > > My urls.py looks like this: > > > > from django.conf.urls.defaults import * > > from django.contrib import admin > > > admin.autodiscover() > > > js_info_dict = { > > 'packages': ( 'hive.promotions',),} > > > urlpatterns = patterns('', > > # Example: > > (r'^', include('promotions.urls')), > > > (r'^hive/', include('promotions.urls')), > > (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', > > js_info_dict), > > > # Admin: > > ('^hiveadmin/(.*)', admin.site.root), > > ) > > -- > > My admin.py looks like this: > > > from django.contrib import admin > > from promotions.models import * > > > class PointTypeAdmin(admin.ModelAdmin): > > list_display= > > ('points_type','date_created','ranking','points_expire','description', > > 'cash_validity_period') > > save_on_top=True > > pass > > > admin.site.register(PointType, PointTypeAdmin) > > plus other model classes.. > > > I seem to be going into blind alleys at the moment, can anyone suggest > > a troubleshooting direction for me to pursue? > > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: You don't have permission to edit anything - new forms admin
Hi, I'm encountering exactly the same problem as yours. Did you finally find the solutions? Thanks, Dave On Feb 17, 1:25 pm, Tipan <t...@ortengo.co.uk> wrote: > I'm having some problems with the New Forms Admin that are giving me > the error message " You don't have permission to edit anything." when > I log into the Admin. I also lose the admin-media so that the page > displays on a plain white background. > > I'm using the latest django release from the trunk r9844. > > Interestingly, I have another app that uses exactly the same database > and this delivers full access for the same user (a superuser). > > I've checked through the urls/settings and admin.py files and both are > identical except for the app name. > > On previous threads it suggests putting print statements in contrib > \admin\__init__.py to check the apps loaded by autodiscover and it > seems to be working as expected: > django.contrib.auth > django.contrib.contenttypes > django.contrib.sessions > django.contrib.admin > django.contrib.humanize > django.contrib.flatpages > hive.promotions > > where hive is my app. > > My urls.py looks like this: > > from django.conf.urls.defaults import * > from django.contrib import admin > > admin.autodiscover() > > js_info_dict = { > 'packages': ( 'hive.promotions',),} > > urlpatterns = patterns('', > # Example: > (r'^', include('promotions.urls')), > > (r'^hive/', include('promotions.urls')), > (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', > js_info_dict), > > # Admin: > ('^hiveadmin/(.*)', admin.site.root), > ) > -- > My admin.py looks like this: > > from django.contrib import admin > from promotions.models import * > > class PointTypeAdmin(admin.ModelAdmin): > list_display= > ('points_type','date_created','ranking','points_expire','description', > 'cash_validity_period') > save_on_top=True > pass > > admin.site.register(PointType, PointTypeAdmin) > plus other model classes.. > > I seem to be going into blind alleys at the moment, can anyone suggest > a troubleshooting direction for me to pursue? > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: You don't have permission to edit anything - new forms admin
On Wed, Feb 18, 2009 at 2:17 AM, Rajesh Dhawanwrote: > > >> >> # Admin: >> ('^hiveadmin/(.*)', admin.site.root), > > > That's no longer the right way to hook the admin into your URL conf. > See here: > > http://docs.djangoproject.com/en/dev//ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf Rajesh - the new technique for adding admin to your project only exists in trunk; the old technique (the one used by Tipan) still works. It won't be the cause of the problems described. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: You don't have permission to edit anything - new forms admin
> > # Admin: > > ('^hiveadmin/(.*)', admin.site.root), > > That's no longer the right way to hook the admin into your URL conf. > See here: > > http://docs.djangoproject.com/en/dev//ref/contrib/admin/#hooking-admi... > > -RD Hi Rajesh, I've been through the documentation you suggested above at some length and also: http://code.djangoproject.com/wiki/NewformsAdminBranch which suggests the approach that I'm using in my urls.py. I've since tested on another PC and what we've done works fine as well, so it maybe that the application may have got corrupted during a recent merge. It's a major headache, as everything we're doing looks right, works on other PC's but not mine. Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: You don't have permission to edit anything - new forms admin
> > # Admin: > ('^hiveadmin/(.*)', admin.site.root), That's no longer the right way to hook the admin into your URL conf. See here: http://docs.djangoproject.com/en/dev//ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf -RD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
You don't have permission to edit anything - new forms admin
I'm having some problems with the New Forms Admin that are giving me the error message " You don't have permission to edit anything." when I log into the Admin. I also lose the admin-media so that the page displays on a plain white background. I'm using the latest django release from the trunk r9844. Interestingly, I have another app that uses exactly the same database and this delivers full access for the same user (a superuser). I've checked through the urls/settings and admin.py files and both are identical except for the app name. On previous threads it suggests putting print statements in contrib \admin\__init__.py to check the apps loaded by autodiscover and it seems to be working as expected: django.contrib.auth django.contrib.contenttypes django.contrib.sessions django.contrib.admin django.contrib.humanize django.contrib.flatpages hive.promotions where hive is my app. My urls.py looks like this: from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() js_info_dict = { 'packages': ( 'hive.promotions',), } urlpatterns = patterns('', # Example: (r'^', include('promotions.urls')), (r'^hive/', include('promotions.urls')), (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), # Admin: ('^hiveadmin/(.*)', admin.site.root), ) -- My admin.py looks like this: from django.contrib import admin from promotions.models import * class PointTypeAdmin(admin.ModelAdmin): list_display= ('points_type','date_created','ranking','points_expire','description', 'cash_validity_period') save_on_top=True pass admin.site.register(PointType, PointTypeAdmin) plus other model classes.. I seem to be going into blind alleys at the moment, can anyone suggest a troubleshooting direction for me to pursue? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Hi guys. I'm having problem with new-forms admin site.
On Sat, Oct 25, 2008 at 12:31 AM, astray <[EMAIL PROTECTED]> wrote: > > [snip config details] % models.py % > > from django.db import models > > class Publisher(models.Model): >name = models.CharField(max_length=30) >address = models.CharField(max_length=50) >city = models.CharField(max_length=60) >state_province = models.CharField(max_length=30) >country = models.CharField(max_length=50) >website = models.URLField() >def __str__(self): >return self.name > Note when using Django 1.0, you should be specifying __unicode__ methods, not __str__ methods. [more snipped] > ==> above are my settings. App name is books. I'm curious about where > to put admin.py file. > (Maybe in my app folder (\books)? That's what I'm doing right now.) > Yes. > > I was at first following my Django book's instruction to create > administration interface and soon realized that the method on the book > was not applicable to Django 1.0. > The online docs are an excellent reference and are up-to-date: http://docs.djangoproject.com/en/dev/ > I'm not interested in several options I can override. Just wanting to > test default interface but It just doesn't work! > > with these settings, I encounter this error > > -- > [snipped] > File "F:\Python26\Lib\site-packages\django\db\backends\util.py", > line 19, in execute >return self.cursor.execute(sql, params) > > ProgrammingError: error: There's no relation named "django_session" > <--- message translated by my own because I'm not English user. Just > focus on the meanig of this message cause this might be not identical. You need to run manage.py syncdb after adding apps to your INSTALLED_APPS -- this is how the tables for those apps get created. It sounds like you did not run syncdb after adding the sessions app to INSTALLED_APPS. Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Hi guys. I'm having problem with new-forms admin site.
% settings.py % MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'mysite.books', 'django.contrib.admin', ) % urls.py % from django.conf.urls.defaults import * from django.contrib import admin from mysite.views import current_datetime, hours_ahead admin.autodiscover() urlpatterns = patterns('', (r'^time/$', current_datetime), (r'^time/plus/(\d{1,2})/$', hours_ahead), (r'^admin/(.*)', admin.site.root), ) % models.py % from django.db import models class Publisher(models.Model): name = models.CharField(max_length=30) address = models.CharField(max_length=50) city = models.CharField(max_length=60) state_province = models.CharField(max_length=30) country = models.CharField(max_length=50) website = models.URLField() def __str__(self): return self.name class Author(models.Model): salutation = models.CharField(max_length=10) first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=40) email = models.EmailField() headshot = models.ImageField(upload_to='/tmp') def __str__(self): return '%s %s' % (self.first_name, self.last_name) class Book(models.Model): title = models.CharField(max_length=100) authors = models.ManyToManyField(Author) publisher = models.ForeignKey(Publisher) publication_date = models.DateField() num_pages = models.IntegerField(blank=True, null=True) def __str__(self): return self.title % admin.py (currently in my app folder (\books) % from django.contrib import admin from mysite.books.models import Book admin.site.register(Book) ==> above are my settings. App name is books. I'm curious about where to put admin.py file. (Maybe in my app folder (\books)? That's what I'm doing right now.) I was at first following my Django book's instruction to create administration interface and soon realized that the method on the book was not applicable to Django 1.0. I'm not interested in several options I can override. Just wanting to test default interface but It just doesn't work! with these settings, I encounter this error -- File "F:\Python26\Lib\site-packages\django\core\servers\basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File "F:\Python26\Lib\site-packages\django\core\servers \basehttp.py", line 635, in __call__ return self.application(environ, start_response) File "F:\Python26\Lib\site-packages\django\core\handlers\wsgi.py", line 243, in __call__ response = middleware_method(request, response) File "F:\Python26\Lib\site-packages\django\contrib\sessions \middleware.py", line 35, in process_response request.session.save() File "F:\Python26\Lib\site-packages\django\contrib\sessions\backends \db.py", line 52, in save session_key = self.session_key, File "F:\Python26\Lib\site-packages\django\contrib\sessions\backends \base.py", line 152, in _get_session_key self._session_key = self._get_new_session_key() File "F:\Python26\Lib\site-packages\django\contrib\sessions\backends \base.py", line 144, in _get_new_session_key if not self.exists(session_key): File "F:\Python26\Lib\site-packages\django\contrib\sessions\backends \db.py", line 25, in exists Session.objects.get(session_key=session_key) File "F:\Python26\Lib\site-packages\django\db\models\manager.py", line 93, in get return self.get_query_set().get(*args, **kwargs) File "F:\Python26\Lib\site-packages\django\db\models\query.py", line 304, in get num = len(clone) File "F:\Python26\Lib\site-packages\django\db\models\query.py", line 160, in __len__ self._result_cache = list(self.iterator()) File "F:\Python26\Lib\site-packages\django\db\models\query.py", line 275, in iterator for row in self.query.results_iter(): File "F:\Python26\Lib\site-packages\django\db\models\sql\query.py", line 206, in results_iter for rows in self.execute_sql(MULTI): File "F:\Python26\Lib\site-packages\django\db\models\sql\query.py", line 1724, in execute_sql cursor.execute(sql, params) File "F:\Python26\Lib\site-packages\django\db\backends\util.py", line 19, in execute return self.cursor.execute(sql, params) ProgrammingError: error: There's no relation named "django_session" <--- message translated by my own because I'm not English user. Just focus on the meanig of this message cause this might be not identical.
Re: How to reuse clean logic for both new forms and new forms admin?
meppum wrote: > The new release of django allows developers to perform custom > validation before the save of an object using self.clean_data just > like in new forms. Is there any way to reuse the logic that we've > already created for our public facing site in the admin site? Yes. You can use the same form class in your admin that you use in your public facing site. See: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#id1 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Inherited models in new forms admin
On Aug 26, 2008, at 2:13 PM, Malcolm Tredinnick wrote: > On Tue, 2008-08-26 at 10:57 -0700, diggs wrote: >> I'm just starting to port my app over to use nfa and the first thing >> that I'm seeing is that derived models are showing up twice in the >> admin. In my case I have a base VideoStory class and >> TwoPersonVideoStory class that derives from VideoStory using multi- >> table inheritance. When I create a new TwoPersonVideoStory it shows >> up >> under the list of VideoStorys as well. Is there a way to prevent >> this? > > No. The row in the VideoStory table has no way of knowing it's > linked to > a row in the TwoPersonVideoStory table at the database level and > Django > doesn't do a query over every possible descendent table every time it > queries the root table (you may think that sounds acceptable for one > table, but now add a few more subclasses and give them a few > subclasses > of their own and it rapidly becomes horribly inefficient without > trying > very hard). Would it work if a ModelAdmin defined its own queryset() method that applied some base filters to remove rows it didn't want to show up in the ChangeList? --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Inherited models in new forms admin
On Tue, 2008-08-26 at 10:57 -0700, diggs wrote: > I'm just starting to port my app over to use nfa and the first thing > that I'm seeing is that derived models are showing up twice in the > admin. In my case I have a base VideoStory class and > TwoPersonVideoStory class that derives from VideoStory using multi- > table inheritance. When I create a new TwoPersonVideoStory it shows up > under the list of VideoStorys as well. Is there a way to prevent this? No. The row in the VideoStory table has no way of knowing it's linked to a row in the TwoPersonVideoStory table at the database level and Django doesn't do a query over every possible descendent table every time it queries the root table (you may think that sounds acceptable for one table, but now add a few more subclasses and give them a few subclasses of their own and it rapidly becomes horribly inefficient without trying very hard). Regards, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Inherited models in new forms admin
I'm just starting to port my app over to use nfa and the first thing that I'm seeing is that derived models are showing up twice in the admin. In my case I have a base VideoStory class and TwoPersonVideoStory class that derives from VideoStory using multi- table inheritance. When I create a new TwoPersonVideoStory it shows up under the list of VideoStorys as well. Is there a way to prevent this? Thanks, Phillip --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Model Inheritance in new-forms admin
On Fri, Jul 18, 2008 at 7:41 PM, cschand <[EMAIL PROTECTED]> wrote: > > Hi Russ >The problem is not solved in the ticket No - that's because it's a bug report. When the bug is fixed, the ticket will be closed. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Model Inheritance in new-forms admin
Hi Russ The problem is not solved in the ticket Satheesh On Jul 18, 4:13 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Fri, Jul 18, 2008 at 7:00 PM, cschand <[EMAIL PROTECTED]> wrote: > > > When I tried model inheritance in new-forms admin, I faced some > > problems > ... > > What is wrong with me? > > You haven't checked the tickets:http://code.djangoproject.com/ticket/6755 > > Yours, > Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Model Inheritance in new-forms admin
hi i had (and still have) the same problem<http://groups.google.com/group/django-users/browse_frm/thread/6d2712678852f20c/59ee10780ea00b61?lnk=gst=model+inheritance+and+admin#59ee10780ea00b61> . really hope this gets fixed (be)for(e) 1.0; patches seem to be available, so it can't be long... ;-) xing fingers On Fri, Jul 18, 2008 at 1:13 PM, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On Fri, Jul 18, 2008 at 7:00 PM, cschand <[EMAIL PROTECTED]> wrote: > > > > When I tried model inheritance in new-forms admin, I faced some > > problems > ... > > What is wrong with me? > > You haven't checked the tickets: http://code.djangoproject.com/ticket/6755 > > Yours, > Russ Magee %-) > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Model Inheritance in new-forms admin
On Fri, Jul 18, 2008 at 7:00 PM, cschand <[EMAIL PROTECTED]> wrote: > > When I tried model inheritance in new-forms admin, I faced some > problems ... > What is wrong with me? You haven't checked the tickets: http://code.djangoproject.com/ticket/6755 Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Model Inheritance in new-forms admin
When I tried model inheritance in new-forms admin, I faced some problems The below is the code i tried class Reporter(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) email = models.EmailField() def __str__(self): return u"%s %s" % (self.first_name, self.last_name) class ReporterChild(Reporter): location = models.CharField(max_length=100) def __str__(self): return "%s" % self.location ReporterChild._meta.get_field('reporter_ptr').blank = True Here I can't saved the data and it throws the Value Error exception with "Cannot assign None: "ReporterChild.reporter_ptr" does not allow null values." error message So I set this field to Null by adding ReporterChild._meta.get_field('reporter_ptr').null = True So its adds fine and working. But when I tried to delete a data. It is throws IntegrityError exception with "datatype mismatch" message. It can delete only commenting the added code. What is wrong with me? Satheesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
new forms admin is there an equiv to unique_for_date
This is what I'm talking about http://www.djangoproject.com/documentation/model-api/#unique-for-date Searching internets can not find any answer. Thanks, -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got fun! Check out Austin360.com for all the entertainment info you need to live it up in the big city! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Annoying little bug that just won't stop -- new forms admin
I Just had a problem with this and it came down to the PIL component on my server not having jpeg support, maybe try installing libjpeg and rebuilding and installing PIL. On Feb 15, 6:59 am, Michael Newman <[EMAIL PROTECTED]> wrote: > As I continue to test this, it appears that inlineimagefields don't > work at all in newforms Admin. Yikes!!! Can someone confirm? > > My code: > > from django.db import models > > class TestObject(models.Model): > somefield = models.CharField(max_length=100) > > class TestObjectImageInline(models.Model): > test_object = models.ForeignKey(TestObject) >image= models.ImageField(upload_to='images') > anotherfield = models.BooleanField(default=True) > > from django.contrib import admin > > class TestObjectInline(admin.TabularInline): > model = TestObjectImageInline > > class TestObjectAdmin(admin.ModelAdmin): > model = TestObject > inlines = [TestObjectInline] > > admin.site.register(TestObject, TestObjectAdmin) > > On Feb 14, 4:34 pm, Michael Newman <[EMAIL PROTECTED]> wrote: > > > I get an 'Uploadavalidimage. Thefileyouuploadedwaseithernot > > animageor acorruptedimage.' When I try to save a model in the > > admin. I had this issue in the oldforms admin as well. I was passed to > > this > > article:http://scottbarnham.com/blog/2007/08/22/edit-inline-with-imagefield-o... > > . The ticket was thrown out because of the anticipation of newforms > > admin. Odd thing is FileField doesnotthrow the same error. > > > Here is my code: > > > from django.db import models > > > class TestObject(models.Model): > > somefield = models.CharField(max_length=100) > > > class TestObjectImageInline(models.Model): > > test_object = models.ForeignKey(TestObject) > >image= models.ImageField(upload_to='images') > > > from django.contrib import admin > > > class TestObjectInline(admin.TabularInline): > > model = TestObjectImageInline > > > class TestObjectAdmin(admin.ModelAdmin): > > model = TestObject > > inlines = [TestObjectInline] > > > admin.site.register(TestObject, TestObjectAdmin) > > > Can others duplicate? I am planning on filing a ticket but I would > > like to figure out where it is that the error is being thrown. Any > > insight on that would be great as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Annoying little bug that just won't stop -- new forms admin
As I continue to test this, it appears that inline image fields don't work at all in newforms Admin. Yikes!!! Can someone confirm? My code: from django.db import models class TestObject(models.Model): somefield = models.CharField(max_length=100) class TestObjectImageInline(models.Model): test_object = models.ForeignKey(TestObject) image = models.ImageField(upload_to='images') anotherfield = models.BooleanField(default=True) from django.contrib import admin class TestObjectInline(admin.TabularInline): model = TestObjectImageInline class TestObjectAdmin(admin.ModelAdmin): model = TestObject inlines = [TestObjectInline] admin.site.register(TestObject, TestObjectAdmin) On Feb 14, 4:34 pm, Michael Newman <[EMAIL PROTECTED]> wrote: > I get an 'Upload a valid image. The file you uploaded was either not > an image or a corrupted image.' When I try to save a model in the > admin. I had this issue in the oldforms admin as well. I was passed to > this > article:http://scottbarnham.com/blog/2007/08/22/edit-inline-with-imagefield-o... > . The ticket was thrown out because of the anticipation of newforms > admin. Odd thing is FileField does not throw the same error. > > Here is my code: > > from django.db import models > > class TestObject(models.Model): > somefield = models.CharField(max_length=100) > > class TestObjectImageInline(models.Model): > test_object = models.ForeignKey(TestObject) > image = models.ImageField(upload_to='images') > > from django.contrib import admin > > class TestObjectInline(admin.TabularInline): > model = TestObjectImageInline > > class TestObjectAdmin(admin.ModelAdmin): > model = TestObject > inlines = [TestObjectInline] > > admin.site.register(TestObject, TestObjectAdmin) > > Can others duplicate? I am planning on filing a ticket but I would > like to figure out where it is that the error is being thrown. Any > insight on that would be great as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Annoying little bug that just won't stop -- new forms admin
I get an 'Upload a valid image. The file you uploaded was either not an image or a corrupted image.' When I try to save a model in the admin. I had this issue in the oldforms admin as well. I was passed to this article: http://scottbarnham.com/blog/2007/08/22/edit-inline-with-imagefield-or-filefield-in-django-admin/ . The ticket was thrown out because of the anticipation of newforms admin. Odd thing is FileField does not throw the same error. Here is my code: from django.db import models class TestObject(models.Model): somefield = models.CharField(max_length=100) class TestObjectImageInline(models.Model): test_object = models.ForeignKey(TestObject) image = models.ImageField(upload_to='images') from django.contrib import admin class TestObjectInline(admin.TabularInline): model = TestObjectImageInline class TestObjectAdmin(admin.ModelAdmin): model = TestObject inlines = [TestObjectInline] admin.site.register(TestObject, TestObjectAdmin) Can others duplicate? I am planning on filing a ticket but I would like to figure out where it is that the error is being thrown. Any insight on that would be great as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: new forms admin
On 3/8/07, enquest <[EMAIL PROTECTED]> wrote: > What effect wil the new form lib have on the admin. I read that its > being remade. But will the admin app bread an will you need to change > your code for the new one? Here's the writeup: http://code.djangoproject.com/wiki/NewformsAdminBranch Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
new forms admin
What effect wil the new form lib have on the admin. I read that its being remade. But will the admin app bread an will you need to change your code for the new one? Enquest --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---