Re: [offtopic] put a title
Just a little hint – it woud be good, when you put an informative title of your emails, so the people can orient what the topic of the email is. Best wishes! Ivan На Sat, 22 Dec 2012 10:16:16 +0530 vinoth kumar renganathanнаписа: > i am new user to django .and i don't know how to add .html > files (template dirs ) to the apps folders .what are the things > want to change in settings.py > > > the error will be templatedoesnotexist >/polls > /admin.py > /__init__.py > /models.py > /tests.py > /urls.py > /views.py > /template >/polls > /index.html > and this order will be correct or not > > for example this will be codings > > {% if latest_poll_list %} > > {% for poll in latest_poll_list %} > href="/polls/{{ poll.id }}/">{{ poll.question }} {% endfor %} > > {% else %} > No polls are available. > {% endif %} > > is it necessary to add htmltag ,header tag and doctype before this > html codings > -- 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: Django Models: How to allow users to select an image from a choice of 3 pictures
На Sun, 15 Jul 2012 18:26:02 -0700 (PDT) crobertsнаписа: > I am familiar with the use of Field.choices for text. > > However, I'd like the same option for images. Is this possible? I > want users to select one image from a list of 3 and be able to save > this. They can later come back in and change it if they wish. I > know that in order to save this, it must be in Models. > > The idea: > > Each day, the has the option of selecting an image: happy face, sad > face, smiley face of how they are feeling. Their selection is > saved. They can go in later to change it if they wish. > > ImageField doesn't seem to do this. It seems to only allow for > uploaded images as opposed to a choice. > Use Choice field with image in the option. You do not need FIleField, couse you don't operate with files at all. You just want to put an image in a select. There are several ways to achieve this: background image (pure html+css) http://binnyva.blogspot.com/2006/01/icons-for-select-menu-options-in.html Jquery UI; or something like this: http://www.marghoobsuleman.com/jquery-image-dropdown -- 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: image in browser
На Thu, 14 Jun 2012 14:21:00 +0530 Satvir Toorнаписа: > > This is a strange thing to want to do. What are you doing with > > `img` in the template? > I am using image_data variable as a image source in the template(html > file). > > > What should i ??? Image is not displaying. Use static files for that: https://docs.djangoproject.com/en/dev/howto/static-files/ -- 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: image in browser
На Thu, 14 Jun 2012 11:45:19 +0530 Satvir Toorнаписа: > hello, > > i wish to display the image into the browser through a template . I > used the following code to retrieve the image from Disk and send that > data to Html file > > def my_image(request): > image_data = open("/home/toor/Desktop/certificate/logo.png", > "rb").read() return render_to_response('myapp/bio.html', > {'img':image_data}, context_instance=RequestContext(request)) > Why don't you use static files? > Now, The image is not availble into the html file that is displaying > in browser, Tell me where I m wrong. You better show us the template too. -- 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: Beginner a bit lost - need some pointers please
На Wed, 5 Oct 2011 15:02:13 -0500 Javier Guerra Giraldezнаписа: > about how to write, check the paragraph about the MTV architecture: If you are familier with MVC (Model, View, Controller), MTV is the same but with different component names. -- 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: howto disable label for field in admin app form?
Source: https://docs.djangoproject.com/en/dev/ref/forms/api/#configuring-html-label-tags If auto_id is False, then the form output will not include tags nor id attributes: f = ContactForm(auto_id=False) I think, this is exactly what you want. На Tue, 4 Oct 2011 14:34:56 +0200 Aljoša Mohorovićнаписа: > On Tue, Oct 4, 2011 at 2:22 PM, BILLION Sébastien > wrote: > > It's a strange question... > > You can replace an admin template with {% extends > > "admin/change_form.html %} for example. > > i don't see why it's a strange question, i have a form field and i > would like to disable rendering of label? > i appreciate suggestions and did consider overriding admin templates > but "admin/change_form.html" is messy and don't know if it's a smart > thing to do in my case. > i've expected some option where i can set label=None by overriding > field/widget init and disable label. > thanks for suggestions but i think i'll just use javascript to remove > label. > > Aljosa > -- 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.
Django-CMS and inherit plugin
Hi all! It's a silly question, but I cannot get it. What does this mean: „The inherit plugin is currently the only core-plugin which can not be used in non-cms placeholders.“ This is taken from the Django-CMS documentation: http://docs.django-cms.org/en/2.2/getting_started/plugin_reference.html#inherit The plugin is properly installed and I can add it from the admin, but when I try to see the public page with my basic template, I've made with the tutorial, I become the following error: Caught AttributeError while rendering: 'NoneType' object has no attribute 'render_plugin' The problem is in the template on the following line: {% placeholder "template_1_content" %} I know, that this has something to do with the sentence from the docs, I cannot understand, but I am stuck... Thanks for the help! Ivan -- 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: mysql installation error
First – It's not a Django question, and second search, read, but try: http://www.fuyun.org/2009/12/install-mysql-for-python-on-windows/ That was the second result I found :) I hope, it is what you need, couse I don't use windows and cannot test the problem and its solution. Ivan На Tue, 20 Sep 2011 22:59:30 -0400 PremAnand Lakshmananнаписа: > Hi, > > When I try to install mysql I get the following error, > > Pls provide your inputs. > > C:\MYSQL\MySQL-python-1.2.3\MySQL-python-1.2.3>python setup.py install > Traceback (most recent call last): > File "setup.py", line 15, in > metadata, options = get_config() > File > "C:\MYSQL\MySQL-python-1.2.3\MySQL-python-1.2.3\setup_windows.py", > line 7 , in get_config > serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, > options['registry_ke > y']) > WindowsError: [Error 2] The system cannot find the file specified > -- 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.
Extending admin's index view
Hallo everybody! I've got problem exteding the admin's index view. I need to pass extra_context to the index of the admin, after the administrator logged in, that's why I'm trying to extend the view. So... What I've got is: In the root of the project I modified urls.py like following: (r'^admin/$', project.admin.admin_site.index), (r'^admin/', include(admin.site.urls)), Again in the root of the project I've got admin.py with the following snippet of code: [...] class AdminSiteRegistryFix( object ): ''' This fix links the '_registry' property to the orginal AdminSites '_registry' property. This is necessary, because of the character of the admins 'autodiscover' function. Otherwise the admin site will say, that you havn't permission to edit anything. ''' def _registry_getter(self): return default_site._registry def _registry_setter(self,value): default_site._registry = value _registry = property(_registry_getter, _registry_setter) class MyAdmin(sites.AdminSite, AdminSiteRegistryFix): @never_cache def index(self, request, extra_context={}): last_report_date = models.Reports.objects.latest().entry_date now = datetime.now() delta = now - last_report_date extra_context['last_report_interval'] = delta.days return super(MyAdmin, self).index(request, extra_context) admin_site = MyAdmin() And it works. I've got the last_report_interval in the index.html template and I can write my lovely message to the admin. The problem is, that the ^admin/$ address swiches between the login and index view, despite of users authentication status. And this is nice, but not working after my changes, written above. Now I see only the app list of the index. When I'm not logged in, I just see an empty list, but I've got no login form... Can anyone help me, understanding why has my login form disappeared? What I can see from the django.contrib.admin.sites is that the admin_view function is the one, calling the login view. But I have noting to do with it, I haven't modify it and I don't understand what disturbs it's functionallity. Thank you in advance for your help! Ivan Ivanov -- 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.