Re: Any Tutorials on Django similar to Web2py ????????????????
There are several ways to manage sessions, or cache. That's up to you according to your needs. You can find documentation about sessions, caching and much more here: https://docs.djangoproject.com/en/1.5/ Rgds On Tue, Aug 20, 2013 at 1:12 PM, JAI PRAKASH SINGH < jaiprakashsingh...@gmail.com> wrote: > Thank you sir, but i need that kind of tutorials which is complete , in > terms of security, session, cache like udacity tutorilas on web2py .. on > web development. > > Please revert back if u have any kind of link on it > > > On Tue, Aug 20, 2013 at 9:35 PM, carloswrote: > >> https://docs.djangoproject.com/en/1.5/intro/tutorial01/ >> >> Cheers >> >> >> On Tue, Aug 20, 2013 at 9:57 AM, JAI PRAKASH SINGH < >> jaiprakashsingh...@gmail.com> wrote: >> >>> Any Tutorials on Django similar to Web2py >>> >>> -- >>> 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. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Django users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/django-users/8i61qvs2tn4/unsubscribe. >> To unsubscribe from this group and all its topics, 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. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- > 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. > For more options, visit https://groups.google.com/groups/opt_out. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: Republish Static Files
Did you run collectstatic ? https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#collectstatic On Tue, May 7, 2013 at 9:41 PM,wrote: > Hello, > > I have site that renders a chart using HighCharts with data from static > csv files, as well as a link to download these files. I am developing > locally using runserver. > However, when I alter the data, the changes are not reflected on the site, > and when I download the files from the site, it gives me the old version of > the data files. > > I am new to django and new to the concept of static files and web servers, > but I read somewhere that static files may need to be 'republished' in > order for viewers to see the changes on the web server. I don't know if > this applies to django, but does anyone know why these changes in the files > are not being reflected on the site at all? > > Much appreciated. > > -- > 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?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Good tutorials on celeryd as a daemon needed?
http://ask.github.io/celery/cookbook/daemonizing.html On Mon, Apr 8, 2013 at 6:01 AM, sparkywrote: > Hi Django people, > > I'm finding it difficult to get my head around running celeryd as a daemon > from the docs on Ubuntu. Does anyone know of any good tutorials or reading > to help me along? > > Thanks > > -- > 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?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Markers on geodjango
http://invisibleroads.com/tutorials/geodjango-googlemaps-build.html Like that? Marcos On Fri, Sep 14, 2012 at 6:30 AM, Coulson Thabo Kgathiwrote: > can i place markers on geodjango maps, cant figure out how to do that > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/PA5XOTjKhsIJ. > 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. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: Is there such a open source django project?
If there is, this is a good place to look for it: http://djangopackages.com/ Marcos On Tue, Apr 17, 2012 at 7:12 AM, James Dengwrote: > Hi all, > > I have a case to manage my staff for customer support, basically I need a > time based schedule table. the point is that we need to know WHO at WHEN > should take care of WHICH customer, we should be able to input a bunch of > support schedule, and get a simple view of it. > > So my question is, is there any existing django project/module to use > before I rush to develop it myself? > > Thanks a lot! > BRs//James > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/xjKi4wQV_1cJ. > 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. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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 ExtraField
You can set a hidden input widget to the form field. Rgds, Marcos On Fri, Feb 24, 2012 at 11:26 AM, coded kidwrote: > Hi guys, How can I get rid of the field that's beside django comment > textarea? (the field, if users fill the field[honeypot] the users > comment will be marked as spam) I hope you get my point? Below is my > code: > > comments/form.html > > {% if user.is_authenticated %} > >{% csrf_token %} >{% if sol %} value="{{request.path}}" />{% endif %} >{% for field in form %} >{% if field.is_hidden %} >{{ field }} >{% else %} >{% if field.name != "name" and field.name != "email" > and field.name != "url" %} >{% if field.errors %}{{ field.errors }}{% endif > %} > {{ field }} >{% endif %} >{% endif %} >{% endfor %} > > > {% else %} >I'm sorry, but you must be logged in to submit comments. > {% endif %} > > -- > 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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: Which IDE should I use for Django?
emacs +1 On Mon, Dec 19, 2011 at 1:46 PM, georgewrote: > emacs +1 > > On Dec 19, 3:42 pm, Masklinn wrote: > > On 2011-12-19, at 16:30 , Andre Terra wrote: > > > > > > > > > What do you mean by embedded Django interpreter? An instance of python > > > running within Aptana? > > > > Django performs a bunch of setup which allow for easy import and > manipulation of the objects related to the instance, which is the reason > why django has a `shell` management command wrapping the Python shell. > > -- > 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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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.
Form for inline formset
Can someone please tell me how can I specify a form to be used by every form inside an inline formset (if possible)? Thanks in advance! Marcos -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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 Development environment
Dev. Arch Linux, python2.7, django-1.3, virtualenv, postgresql (if possible), south, django-extensions, Emacs Dep. Ubuntu Server, fabric, Nginx, supervisord, uwsgi Rgds, Marcos On Mon, Aug 22, 2011 at 7:07 PM, Stephen Jackson < jackson.stephe...@gmail.com> wrote: > I am new to the world of Django. I would like to hear from other django > developers describe their dev environment (tools, os, editors, etc.). > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/Fq-jCVxrK7AJ. > 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. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: signals pre_save vs model's save()
You can set more than 1 [pre,post]_save signal per-model, no problem. I generally, and I'm not saying this is the django way, do it like this: app_name/ __init__.py modes.py views.py signals.py Inside my signals.py I have all my signal declarations and connections. And inside __init__.py I just do: import app_name.signals Rgds, Marcos On Sat, May 28, 2011 at 7:05 AM, Mateusz Harasymczukwrote: > I am thinking about splitting my model's save() method over few signals. > > For example, stripping spaces and making string capitalized. > > I have even more sophisticated problems such as making an object field > active set to False basing on various parameters from other fields, such as > expiration date, or good or bad karma points. > > What do you think, it is generally good idea, to keep models file clean out > of heavily overloaded save() methods? > > How about making more than one signal pre_save to the same model? > > > @receiver(pre_save, sender=X) > def strip_chars(sender, **kwargs): > pass > > @receiver(pre_save, sender=X) > def capitalize_name(sender, **kwargs): > pass > > @receiver(pre_save, sender=X) > def make_inactive(sender, **kwargs): > pass > > Will it work? > > I want to put those in signals/X.py > where X is my model name > > Where to import them? in my model file? > or it will happen "automagicly" like with admin.py file? > (I think that python's explicit rule forbids that way, therefore where to > import those signals, avoiding recurring imports [signal.py import model.py > and model imports signals])? > > -- > 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. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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 help
Read the static-files docs On Sat, Apr 30, 2011 at 4:14 AM, Sunil Chughwrote: > how can i used static_root > > -- > 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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: how to setup apache server for django?
You need to create a VirtualHost for each one of your projects. http://httpd.apache.org/docs/2.0/vhosts/ Marcos On Wed, Apr 6, 2011 at 5:24 AM, ug Charliewrote: > I have tried whole day. And I just got a new django project works. > > But I want my old project works too. Anyone could give me some info? > > -- > 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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: fixtures with updated timestamps
You can write a pre_save signal http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_save Hope it helps, Marcos On Wed, Mar 30, 2011 at 8:09 AM, Robert Šmolwrote: > Hi, > > is it possible to load fixtures of models that have a datetime field and > then updated those? > > I mean we have a nice preset database, but it gets old over time, I need to > refresh the time attributes during tests and new development deployments. > > Robert > > -- > 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. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: values_list of ordered annotated QuerySet
This should work without grabbing the entire table: [x[0] for x in Wizard.objects.filter(**filterargs).annotate(wpower=Sum('creatures__power')).order_by('- wpower').values_list('id', 'wpower')] Rgds, Marcos On Tue, Mar 22, 2011 at 5:25 PM, Andreas Pfrenglewrote: > just pulling it up again... > > -- > 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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: Where can I find the admin/base_site.html
It depends on what you are using. For me is /usr/lib/python2.7/site-packages/django/contrib/admin/templates/admin/ Hope it helps. On Wed, Feb 23, 2011 at 6:06 AM, DJ Chungwrote: > I am going through the tutorial on Djangoproject.com. I'm trying to > work on templates and I don't know where to find admin/base_site.html > > Where's the actual code I can copy and paste? > > -- > 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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: External Javascript Files
you need to put it in your media folder. http://docs.djangoproject.com/en/1.2/howto/static-files/ Rgds, Marcos On Thu, Feb 17, 2011 at 2:44 PM, hank23wrote: > Is it possible to use external javascript files with a django app? If > so what folder does the javascript file need to be placed in? So far I > tried putting it in the bas folder of the app. I want to use it in and > it doesn't seem to work there if I reference it directly using only > just the filename in my javascript reference in the html file where I > call a function in my external file. So am I referencing it wrong or > do I need to put it in some other folder? > > -- > 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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: site styling works with development server but not apache
This is the relevant VirtualHost configuration for admin media WSGI Alias /media "/usr/local/www/static/media/" Order allow,deny Allow from all MOD_PYTHON SetHandler None If this doesn't work perhaps you shoud could paste your VirtualHost configuration. Rgds, Marcos On Thu, Feb 17, 2011 at 2:23 PM, Ashish Agarwalwrote: > I'm still having trouble. My directory structure is: > > /usr/local/www/static > | > +- contrib/admin/media -- symlink to django/contrib/admin/media > | > +- media/admin/base_site.html -- modified version of base_site.html > > I've tried every combination of the following, but nothing is working: > > DocumentRoot /usr/local/www/static > - does this need to be set at all? > > Alias /media/ /usr/loca/www/static/... > - not quite sure which directory this should point to > - I've tried all sensible options, but none work > > ADMIN_MEDIA_PREFIX = '/media/' > - Does this simply have to be equal to whatever URL is used in the Alias > directive above? > > Thank you. > > > On Thu, Feb 17, 2011 at 10:30 AM, Mike Ramirez wrote: > >> On Thursday, February 17, 2011 07:14:16 am ashish wrote: >> >> > Hi all. I followed the tutorial to setup a basic django site and run >> >> > it with the development server. Everything looks fine. Then, I >> >> > configured to use apache. Everything seems to work except the styling. >> >> > The login and admin pages have no formatting. On IRC I was told the >> >> > issue is that the development server automatically serves the >> >> > necessary media, but that you have to explicitly configure apache to >> >> > serve static media. >> >> > >> >> > Okay, but which media needs to be served for the styling to work? I >> >> > have not found the answer in the docs. Thank you for any help. >> >> normally the path assigned to MEDIA_ROOT and ADMIN_MEDIA ... see below >> for the configuration settings (pick your production environment) >> >> http://docs.djangoproject.com/en/1.2/howto/deployment >> >> Mike >> >> -- >> >> If God had not given us sticky tape, it would have been necessary to >> invent it. >> >> -- >> 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 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. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: imported tuples/variables don't get translated
Are you doing: from django.utils.translation import ugettext_lazy as _ ? or: from django.utils.translation import ugettext as _ ? The first one shoud work. Rgds, Marcos On Tue, Feb 8, 2011 at 7:11 PM, Ivo Brodienwrote: > If I import some tuple which is used for choices in a forms.RadioSelect > widget, then the choices don’t get translated > > models.py: > > BOOL_CHOICES = ((True, _(u'Yes')), (False, _(u'No'))) > > forms.py: > > from models import BOOL_CHOICES > > 1) does work an translates the choices > form.fields['accomdation'].widget = forms.RadioSelect(choices = ((True, > _(u’Yes')), (False, _(u'No' > > 2) does not translate the choices > form.fields['accomdation'].widget = forms.RadioSelect(choices = > BOOL_CHOICES) > > > something similar happens for a label > > STATIC = _(u”mystring”) > > ...label = STATIC does not work > ...label = _(STATIC) does work > > > Is this a bug or a desired behavior or am I missing something? > > -- > 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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: Looking for IDE + FTP
On Tue, Feb 8, 2011 at 5:43 PM, Daniel Rosemanwrote: > On Tuesday, February 8, 2011 8:30:54 PM UTC, Karen McNeil wrote: >> >> I have three Django sites that I've been working on recently and I've >> been doing most of the development work in Dreamweaver. I don't use >> any of the wysiwyg features (or, pretty much, any of the Dreamweaver >> program features), but I like it because I can do all the the code >> edits and the FTP transfers all in one program. I like being able to >> grab a remote file, make some code changes, save and upload all at >> once, and view a nice graphical display of the file structure for the >> local and remote sites. >> >> Problem is, Dreamweaver's code view is definitely not built for >> Python, and it doesn't look like they have any plans to support it any >> time in the foreseeable future. Which means that I get no color- >> coding of the code, and I'm constantly getting indentation errors. >> >> I've always had Dreamweaver on my computer (a Mac) and so have never >> used a separate FTP program, and the only IDE I've ever used is IDLE. >> I used IDLE when I was first learning Python, but now that I'm working >> with the websites, I find it much more convenient to just open the >> files from within DW. Does anyone know of another, Python-friendly, >> program that I could use for both code-editing and ftp? >> >> Thanks, >> Karen > > > Don't do this. Please. Really really really don't do this. > > It is an incredibly bad idea to edit code and upload it directly to the > site. There are so many easy ways to break the site. You should be storing > your code in a version control system, and exporting and deploying from > there. FTPing code to the live server is a disaster waiting to happen. > +1 > -- > DR. > > -- > 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. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: Change null representation when you're using choices widget.
s/left/leave/ sorry fot the double post. On Fri, Feb 4, 2011 at 11:37 AM, Marcos Moyano <marcosmoy...@gmail.com>wrote: > Remove (None, "No Period") from your choices and left the required=False on > your form field. That should work. > > Rgds, > Marcos > > > On Fri, Feb 4, 2011 at 11:31 AM, Marc Aymerich <glicer...@gmail.com>wrote: > >> On Fri, Feb 4, 2011 at 12:12 PM, Tom Evans <tevans...@googlemail.com> >> wrote: >> > On Fri, Feb 4, 2011 at 11:07 AM, Marc Aymerich <glicer...@gmail.com> >> wrote: >> >> Hi >> >> In some choices widgets I want to represent null values as u'No >> >> period' instead of u'' >> >> >> >> I try with: >> >> >> >> PERIOD_CHOICES = getattr(settings, 'PERIOD_CHOICES', >> >> ((None, >> >> ugettext('No Period')), >> >> (DAILY, >> ugettext('Daily')), >> >> (MONTHLY, >> >> ugettext('Monthly')), >> >> (ANUAL, >> ugettext('Anual')), >> >> )) >> >> period = models.CharField(max_length=1, >> >> choices=settings.PERIOD_CHOICES, null=True) >> >> >> >> But when I choose "No Period" I get this form validation error: Value >> >> u'None' is not a valid choice. >> >> >> >> Any idea? >> >> Thanks! >> > >> > form.Field doesn't take null as an option, you want required[1]: >> > >> > """ >> > By default, each Field class assumes the value is required, so if you >> > pass an empty value -- either None or the empty string ("") -- then >> > clean() will raise a ValidationError exception: >> > """ >> > >> > Cheers >> > >> > Tom >> > >> > [1] http://docs.djangoproject.com/en/1.2/ref/forms/fields/#required >> >> >> Hi Tom, >> I override the default admin form with this: >> >> class MonitorAdminForm(ModelForm): >>class Meta: >>model = Monitor >>period = forms.ChoiceField(required=False, choices = >> settings.PERIOD_CHOICES) >> >> Now period has required=False but still raise the validation error: >> Value u'None' is not a valid choice. >> >> What is strange for me is although I put the None value on >> PERIOD_CHOICES the error seems to say that None is interpreted as a >> unicode instead of None. Maybe this is the point, if it's, how can I >> declare a null value in PERIOD_CHOICES definition ? >> >> Thanks! >> >> >> >> >> >> -- >> Marc >> >> -- >> 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<django-users%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> >> > > > -- > Some people, when confronted with a problem, think “I know, I'll use > regular expressions.” Now they have two problems. > > Jamie Zawinski, in comp.emacs.xemacs > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: Change null representation when you're using choices widget.
Remove (None, "No Period") from your choices and left the required=False on your form field. That should work. Rgds, Marcos On Fri, Feb 4, 2011 at 11:31 AM, Marc Aymerichwrote: > On Fri, Feb 4, 2011 at 12:12 PM, Tom Evans > wrote: > > On Fri, Feb 4, 2011 at 11:07 AM, Marc Aymerich > wrote: > >> Hi > >> In some choices widgets I want to represent null values as u'No > >> period' instead of u'' > >> > >> I try with: > >> > >> PERIOD_CHOICES = getattr(settings, 'PERIOD_CHOICES', > >> ((None, > >> ugettext('No Period')), > >> (DAILY, > ugettext('Daily')), > >> (MONTHLY, > >> ugettext('Monthly')), > >> (ANUAL, > ugettext('Anual')), > >> )) > >> period = models.CharField(max_length=1, > >> choices=settings.PERIOD_CHOICES, null=True) > >> > >> But when I choose "No Period" I get this form validation error: Value > >> u'None' is not a valid choice. > >> > >> Any idea? > >> Thanks! > > > > form.Field doesn't take null as an option, you want required[1]: > > > > """ > > By default, each Field class assumes the value is required, so if you > > pass an empty value -- either None or the empty string ("") -- then > > clean() will raise a ValidationError exception: > > """ > > > > Cheers > > > > Tom > > > > [1] http://docs.djangoproject.com/en/1.2/ref/forms/fields/#required > > > Hi Tom, > I override the default admin form with this: > > class MonitorAdminForm(ModelForm): >class Meta: >model = Monitor >period = forms.ChoiceField(required=False, choices = > settings.PERIOD_CHOICES) > > Now period has required=False but still raise the validation error: > Value u'None' is not a valid choice. > > What is strange for me is although I put the None value on > PERIOD_CHOICES the error seems to say that None is interpreted as a > unicode instead of None. Maybe this is the point, if it's, how can I > declare a null value in PERIOD_CHOICES definition ? > > Thanks! > > > > > > -- > Marc > > -- > 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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- 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: i18n django models
I've worked on/with this app https://github.com/Anue/django-polyglot/ Hope it helps. Rgds, Marcos On Fri, Jan 7, 2011 at 12:20 PM, Mo Mughrabiwrote: > Hello, > > in my design there are some models where I need to store certain fields in > different languages. I was wondering if anyone has done it before? I saw > some django modules that help do model translations but some of them did not > work properly. > > Any best practices out there? below is my code > > *my model.py* > > class Lookup_I18n(models.Model): > i18n_code = models.CharField(max_length=5, > default=settings.LANGUAGE_CODE) > value = models.CharField(max_length=300) > > class Lookup(models.Model): > > purpose = models.CharField(max_length=10) > key = models.CharField(max_length=10) > value_i18n = models.ForeignKey(Lookup_I18n) > value = models.Field() > > class Meta: > unique_together = (('purpose', 'key'),) > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Date Error in Admin Form
Take a look at the docs on how to set up valid input formats http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#date-format Rgds, Marcos On Wed, Dec 29, 2010 at 1:39 PM, ckar...@googlemail.com < ckar...@googlemail.com> wrote: > Hi everybody, > > I'm getting a strange error with a datefield in the django admin. > > My Settings: > · TIME_ZONE = 'Europe/Berlin' > · LANGUAGE_CODE = 'de-DE' > · USE_I18N = True > > The according models.py entry: > zeithorizont = models.DateField(blank=True, null=True) > > Screenshot (german): http://static.karrie.info/djangoformerror.png > > I can't figure it out... > > Thank you, > Christian > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: simple.direct_to_template and query objects
I think you are looking for object_detail, not direct_to_template. http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-list-detail-object-detail Rgds, Marcos On Thu, Dec 16, 2010 at 9:32 AM, MarcoSwrote: > Hi people, I want to define a generic view using > simple.direct_to_template, something like this: > > (r'^detail_event/(?P\d+)/$', simple.direct_to_template, > { >'extra_context': {'event': Event.objects.get(id=object_id),} >}), > > Of course this doesn't work, django tell me that 'object_id' is not > defined. > How can I access at the object_id value? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Display related field in queryset
You can use field lookups: http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups-intro ie: Travels.objects.values('date', 'destination__name') Rgds, Marcos On Mon, Dec 13, 2010 at 6:51 AM, nsbkwrote: > Hello, > > I'm using http://code.google.com/p/django-jqgrid/ to display grids > into a Django application. Since I'm pretty new to Django I don't know > how to tell Django to retrurn the value of the related field instead > of the id of the related field. What I do now is: travels = > Travel.objects.values('date','destination'), but that returns the date > of the travel and the id of the destination, FK to Destination model/ > table. How should I query Django so it returns the description of the > destination instead of its id? > > Thanks in advance. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Extending AdminSite for custom views
Add your custom urls before the admin include urls directive: urlpatterns += patterns('', (r'^admin/myview/$', 'your_admin_view'), (r'^admin/', include(admin.site.urls)), ... and continue working as usual. Django will go through the urls in descending order matching your custom url before loading all the other admin urls. Rgds, Marcos On Sat, Dec 11, 2010 at 1:33 PM, William Grzybowskiwrote: > Hello, > > I am trying to extend AdminSite so I can provide custom views, so far > i have this: > > class MyAdminSite(AdminSite): > >def get_urls(self): >urls = super(self.__class__, self).get_urls() >my_urls = patterns('', >(r'^myview/$', self.admin_view(myview)) >) >return my_urls + urls > > myadmin = MyAdminSite() > > admpattern = patterns('', (r'^admin/', include(myadmin.urls)),) > > It works fine, except for one reason. I don't get any ModelAdmin > registered in this admin, because all external apps register it doing > admin.site.register(). > > I figured out do add the registered models from site instance to > myadmin through: > myadmin._registry = site._registry > > But it doesn't feel right. > > Anyone with experience in this could point me out to the most correct > answer for this problem? > > Thank you! > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Newbie question: many-to-many model creation
http://www.djangoproject.com/documentation/models/many_to_many/ Rgds, Marcos On Fri, Dec 10, 2010 at 8:54 AM, girish shabadimath < girishmss.1...@gmail.com> wrote: > Thanks for the reply,, > Here are my models > > class Checkers(models.Model): >name = models.CharField(max_length = 100) >weight = models.FloatField(default = 0) >desc = models.CharField(max_length = 1000) > > class PrepCheckers(models.Model): >name = models.CharField(max_length = 150) >ABCcheckers = models.ManyToManyField(Checkers, > related_name = 'prevent45checkers') > > now how to create PrepCheckers obj ? > > > > On Fri, Dec 10, 2010 at 5:15 PM, Kenneth Gonsalveswrote: > >> On Fri, 2010-12-10 at 16:55 +0530, girish shabadimath wrote: >> > im new to django >> > >> > im using django 1.2 >> > i have a model that has one many-to-many relationship field >> > >> > How to create a object of this model ? >> > >> > what to pass for the field that has many-to-many relationship? >> >> please give some details of your models >> -- >> regards >> Kenneth Gonsalves >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To post to this group, send email to django-us...@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. >> >> > > > -- > Girish M S > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Removing title from each admin page
Sure there is. You have to override the template: django/contrib/admin/templates/admin/base.html Create an admin folder within your templates folder, copy that template over that admin folder and remove the "{{ title }}" statement. Hope it helps. Marcos On Fri, Nov 26, 2010 at 7:37 AM, Luca Casagrandewrote: > Hello folks, > is there any way to remove the title over each admin element, like > "Site administration" or "Select..to change". > > Thanks > Luca > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Display ForeignKey label rather than ID in a CharField
You need to specify the __unicode__ method of the model holding the Fish object. ie: class FishHolder(models.Model): name = models.CharField(...) . def __unicode__(self): return self.name That should display the names instead of the ids. Rgds, Marcos On Fri, Nov 19, 2010 at 3:34 PM, Jamie Pittockwrote: > I have to override the default display of a foreignkey field in a form > and instead display it as a CharField. Currently it displays the > selection's ID but I need to display the label instead > > To be clear, the select option would be the default display for the > ForeignKey. At the moment after I've turned the display to a > CharField it displays 23 in the field. I need to display Fish. > > Fish > > Any help appreciated. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: how to hide a field on
class PostForm(forms.ModelForm): registered_date = forms.DateTimeField(widget=forms.HiddenInput) class Meta: model = Post class PostAdmin(admin.ModelAdmin): form = PostForm admin.register(Post, PostAdmin) Rgds, Marcos On Thu, Nov 18, 2010 at 5:11 PM, Anderson Goulartwrote: > Hi, > > Imagine that I have a simple model like this: > > import datetime > > class Post(models.Model): >title = models.CharField(max_legth=100) >desc = models.TextField() >registered_date = > models.DateTimeField(default=datetime.datetime.now) > > Now I want to use admin interface to fill those fields with an exception: > registered_date should be a hidden field filled with the default value. How > to set this option? > > > thanks, global > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski, in comp.emacs.xemacs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: two foreignky for "User"
Use related_name (http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.related_name) Rgds, Marcos At Tue, 9 Nov 2010 07:20:45 -0800 (PST), luckrill wrote: > > I write following models: > > class article(models.Model): > created_by = models.ForeignKey('User') > edited_by = models.ForeignKey('User') > > django report error. How to ForeignKey "User" for two field. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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 received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.