django-cms context_processors.media has been deprecated
This below command errors generates when i run my program with this command python manage.py runserver /usr/local/lib/python2.7/dist-packages/cms/context_processors.py:20: DeprecationWarning: cms.context_processors.media has been deprecated in favor of cms.context_processors.cms_settings. Please update your configuration 'configuration', DeprecationWarning) -- 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/d904db1e-c639-4ed2-b35a-5bbbfb0bf7d2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: I can't connect Django with SQL Anywhere 11 Database
Elio. have you defined your database in your local settings.py file? -- 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/8797eb16-2beb-4bbf-a738-214dca3ab50e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: I can't connect Django with SQL Anywhere 11 Database
Elio. have you define your database in your local settings.py file? -- 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/5551a458-3bfa-42da-840d-58478dde2001%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
VIEW PERMISSION
An old Query / I know that but need assistance! so dear django users see what i want to ask and what i did: *Story:* As django admin has three permissions in it's auth : add, change, delete! I want to add view permission in this auth in admin panel.I know i have to customize permissions to add view permission in 'auth|permission|can view permission' to view all entries! but how ! for this i followed several patches uploaded by django project. one is 8 years old (https://code.djangoproject.com/ticket/820) and this one https://code.djangoproject.com/ticket/8936 is for databrowse functionality which i really don't need!.. finally i find this one see below: *NEEDED PATCH:* *[X] 1. Added 'view' to default permission list* #./contrib/auth/management/init.py def _get_all_permissions(opts): "Returns (codename, name) for all permissions in the given opts." perms = [] for action in ('add', 'change', 'delete', 'view'): perms.append((_get_permission_codename(action, opts), u'Can %s %s' % (action, opts.verbose_name_raw))) return perms + list(opts.permissions) *[X] 2. Test the 'view' permission is added to all models* run manage.py syncdb I confirmed that view permission is now added for all tables in the auth_permissions table *[X] 3. Add "get\_view_permission" to default model class.* Added get\_view_permission to the model class. You can find this in the file ./db/models/options.py This is used by the admin class in the next step. def get_view_permission(self): return 'view_%s' % self.object_name.lower() *[X] 4. Add "has\_view_permission" to default admin class* Just to be consistent I'm going to add "has\_view_permission" to the system. Looks like it should be somewhere in *contrib/admin/options.py*. Made sure if the user has has change permission, then view permissions are automatically implied. # /contrib/admin/options.py # Added has_view_permissions def has_view_permission(self, request, obj=None): """ Returns True if the given request has permission to change or view the given Django model instance. If obj is None, this should return True if the given request has permission to change *any* object of the given type. """ opts = self.opts return self.has_change_permission(request, obj) or \ request.user.has_perm(opts.app_label + '.' + opts.get_view_permission()) # modified get_model_perms to include 'view' too. # No idea where this may be used, but trying to stay consistent def get_model_perms(self, request): """ Returns a dict of all perms for this model. This dict has the keys add, change, and delete and view mapping to the True/False for each of those actions. """ return { 'add': self.has_add_permission(request), 'change': self.has_change_permission(request), 'delete': self.has_delete_permission(request), 'view': self.has_view_permission(request), } # modified response_add function to return the user to the mode list # if they added a unit and have view rights ... else: self.message_user(request, msg) # Figure out where to redirect. If the user has change permission, # redirect to the change-list page for this object. Otherwise, # redirect to the admin index. #if self.has_change_permission(request, None): if self.has_change_permission(request, None) or self.has_view_permission(request, None): post_url = '../' else: post_url = '../../../' return HttpResponseRedirect(post_url) # modified the change_view function so it becomes the details # for users with view permission #if not self.has_change_permission(request, obj): if not (self.has_change_permission(request, obj) or (self.has_view_permission(request, obj) and not request.POST)): raise PermissionDenied # modified the changelist_view function so it shows the list of items # if you have view permissions def changelist_view(self, request, extra_context=None): "The 'change list' admin view for this model." from django.contrib.admin.views.main import ChangeList, ERROR_FLAG opts = self.model._meta app_label = opts.app_label #if not self.has_change_permission(request, None): if not (self.has_change_permission(request, None) or self.has_view_permission(request, None)): raise PermissionDenied *[X] 5. Update default template to list models if user has view permission* I modified the default template in contrib/admin/templates/admin/index.html. This could also be handled by copying the file
View Permissions -- DJANGO
An old Query / I know that but need assistance! so dear django users see what i want to ask and what i did: *Story:* As django admin has three permissions in it's auth : add, change, delete! I want to add view permission in this auth in admin panel.I know i have to customize permissions to add view permission in 'auth|permission|can view permission' to view all entries! but how ! for this i followed several patches uploaded by django project. one is 8 years old ( https://code.djangoproject.com/ticket/820) and this one https://code.djangoproject.com/ticket/8936 is for databrowse functionality which i really don't need!.. finally i find this one see below: *NEEDED PATCH:* *[X] 1. Added 'view' to default permission list* #./contrib/auth/management/init.py def _get_all_permissions(opts): "Returns (codename, name) for all permissions in the given opts." perms = [] for action in ('add', 'change', 'delete', 'view'): perms.append((_get_permission_codename(action, opts), u'Can %s %s' % (action, opts.verbose_name_raw))) return perms + list(opts.permissions) *[X] 2. Test the 'view' permission is added to all models* run manage.py syncdb I confirmed that view permission is now added for all tables in the auth_permissions table *[X] 3. Add "get\_view_permission" to default model class.* Added get\_view_permission to the model class. You can find this in the file ./db/models/options.py This is used by the admin class in the next step. def get_view_permission(self): return 'view_%s' % self.object_name.lower() *[X] 4. Add "has\_view_permission" to default admin class* Just to be consistent I'm going to add "has\_view_permission" to the system. Looks like it should be somewhere in *contrib/admin/options.py*. Made sure if the user has has change permission, then view permissions are automatically implied. # /contrib/admin/options.py # Added has_view_permissions def has_view_permission(self, request, obj=None): """ Returns True if the given request has permission to change or view the given Django model instance. If obj is None, this should return True if the given request has permission to change *any* object of the given type. """ opts = self.opts return self.has_change_permission(request, obj) or \ request.user.has_perm(opts.app_label + '.' + opts.get_view_permission()) # modified get_model_perms to include 'view' too. # No idea where this may be used, but trying to stay consistent def get_model_perms(self, request): """ Returns a dict of all perms for this model. This dict has the keys add, change, and delete and view mapping to the True/False for each of those actions. """ return { 'add': self.has_add_permission(request), 'change': self.has_change_permission(request), 'delete': self.has_delete_permission(request), 'view': self.has_view_permission(request), } # modified response_add function to return the user to the mode list # if they added a unit and have view rights ... else: self.message_user(request, msg) # Figure out where to redirect. If the user has change permission, # redirect to the change-list page for this object. Otherwise, # redirect to the admin index. #if self.has_change_permission(request, None): if self.has_change_permission(request, None) or self.has_view_permission(request, None): post_url = '../' else: post_url = '../../../' return HttpResponseRedirect(post_url) # modified the change_view function so it becomes the details # for users with view permission #if not self.has_change_permission(request, obj): if not (self.has_change_permission(request, obj) or (self.has_view_permission(request, obj) and not request.POST)): raise PermissionDenied # modified the changelist_view function so it shows the list of items # if you have view permissions def changelist_view(self, request, extra_context=None): "The 'change list' admin view for this model." from django.contrib.admin.views.main import ChangeList, ERROR_FLAG opts = self.model._meta app_label = opts.app_label #if not self.has_change_permission(request, None): if not (self.has_change_permission(request, None) or self.has_view_permission(request, None)): raise PermissionDenied *[X] 5. Update default template to list models if user has view permission* I modified the default template in contrib/admin/templates/admin/ index.html. This could also be handled by copying the file t
Re: I can't connect Django with SQL Anywhere 11 Database
Elio -- Have you used UTF-8 *By default, with a UTF-8 database, MySQL will use the utf8_general_ci collation. This results in all string equality comparisons being done in a case-insensitive manner. That is, "Fred" and "freD" are considered equal at the database level. If you have a unique constraint on a field, it would be illegal to try to insert both "aa" and "AA" into the same column, since they compare as equal (and, hence, non-unique) with the default collation * *Collation settings* in https://docs.djangoproject.com/en/dev/ref/databases/ -- 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/ae11c3fc-16fc-4e73-b32c-3725c6731788%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.