RadioSelect Widget : Incorrect/Wrong Mark-up?

2010-02-28 Thread czamb...@gmail.com
It looks like the mark-up used for the RadioSelect widget is
incorrect.

For example:
from django import forms
class PersonForm(forms.Form):
GENDER_OPTIONS = (
('M','Male'),
('F','Female'),
)
gender =
forms.ChoiceField(widget=forms.RadioSelect(),choices=GENDER_OPTIONS,
label="I am")
>>> form = PersonForm()
>>> print form.as_p()
I am: 
 Male
 Female


Notice how the label contains the input, radio, field. Shouldn't the
mark-up be the following:

I am: 
Male 
Female


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-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 use a customized logging formatter class

2012-10-21 Thread czamb...@gmail.com
As it happens I was looking into this yesterday because my request object 
includes a couple of attributes that I would like to see listed in the 
string representation of the request object. 

Your LOGGING settings  needs to have a fomatter entry that looks something 
like:
'formatters': {
  'my_formatter_name': {
'()': my_project.module_name.UniqueRequestIdFormatter
  }
}

Make sure to set the formatter attribute of your handler to be the name you 
gave to your customer formatter. In my example above it would be 
'my_formatter_name'. The '()' is a special key which tells the logger that 
a "Factory" will be used. You can read more about it 
here: 
http://docs.python.org/library/logging.config.html#logging-config-dict-userdef

You may also want to look at Custom error 
reports: 
https://docs.djangoproject.com/en/1.4/howto/error-reporting/#custom-error-reports
 
(This is what I ended up using instead of a custom formatter)

On Saturday, October 20, 2012 9:59:17 PM UTC-4, Ali wrote:
>
> I have written this custom formatter which inherits from 
> logging.Formatter, how can I configure logging settings so that I can use 
> this for a logger. I see the example in docs where I can update the 
> formatter string but dont know how to link a class to do that.
>
> class UniqueRequestIdFormatter(logging.Formatter):
> def format(self, record):
> record.message = record.msg % record.args
> record.asctime = self.formatTime(record)
> format = u'%s %s %-10s %s +%s %s' % (
> record.levelname,
> record.request.META['REMOTE_ADDR'],
> record.request.user.id if record.request.user.id else 
> record.request.user,
> record.asctime,
> record.request.method,
> record.request.path,
> record.message
> ).encode('utf-8')
> pprint.pprint(record.__dict__)
> return format % record.__dict__
>

-- 
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/-/aazN4siEBv0J.
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.



Question on the purpose of specific files on a DB Backend(django-odbc)

2011-01-10 Thread czamb...@gmail.com
I am asking the question here because nobody seems to respond to
tickets or questions on the django-odbc group. I have found a couple
of problems on the django-odbc backend. I fixed one of them, it was
using a column alias in the order by clause which is not supported by
MSSQL,  by making a simple change on query.py but for the second
problem I am finding that I need to update compiler.py which leads me
to my question. What is the difference between query.py and
compiler.py? When is one used as opposed to the other?

-- 
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.