I want to display a Model field specially in the admin change form. I've found that I can do {% if field.field.name == "field_name" %} in the template, but ideally, I'd like a more generic approach
bsl10 joined the channel
I've tried to add my_field.is_special = True to the Model class, but it doesn't seem to be available to the template
Genitrust joined the channel
bradfordli123 has quit
Is there a way to do this or a better way to do it perhaps?
rpkilby joined the channel
tsukasa__ joined the channel
retailify has quit
FunkyBob
in what way do you want to display it special?
bk_0 joined the channel
bsl10 has quit
dmsalta joined the channel
dioo
FunkyBob: I want to just print {{ field.content }} instead of printing <label>field_name</label><p>field_value</p> as it is ReST rendered HTML
bayman has quit
_nemo_ has quit
s/field.content/field.contents/
FunkyBob
so it's already HTML ?
bsl10 joined the channel
dioo
FunkyBob: Yes
FunkyBob
what you can do is omit the field, add a "readonly field" which refers to a method o nthe admin class which returns what you want
bayman joined the channel
aditi_gupta joined the channel
bayman
is there a good social networking package to allow Users to have a profile, send messages and see each other's newsfeed?
FunkyBob: Omit the field as in not have it in the Model? If so, I can't since I want the rendered text to be part of the Model (it needs to be displayed on the actual website too)
FunkyBob
not have it in the form
it sounds like something the user won't be editing directly, yes?
It is readonly alright. The issue is that, if I read fieldset.html correctly, it gets {{ field.label_tag }} prepended
I think that should do it
yes
FunkyBob
hmm
tbh -- it's admin, it's not something I bother customising much, as all the work should go to the real management interface
dcrouch joined the channel
dioo
Well, I suppose a better question would be: is there a way to add a field.is_raw "property" to a given field so that I can do {% if field.is_raw %} in the template?
FunkyBob
all that is in the list_display docs
dioo
I would expect that if something like that is possible, it should be the same in the admin as well as in the site proper?
jnoob22 joined the channel
FunkyBob
there is one to say it may contain html
but it won't effect the field
dlam has quit
danifus joined the channel
Taios has quit
jnoob22
if anyone is interested, I am writing some web client tests and would invite anyone to have a look and let me know if I'm doing this right or not: http://dpaste.com/3477NY7
I've followed the docs but am wondering if the way I'm doing it is a good way of doing it or bad/incomplete.
FunkyBob
if anyone is interested, I'm writing a pluggable static asset mangling tool... and am intereted in input/requirements
bsl10 has quit
bsl10 joined the channel
newjersey has quit
bsl10 has quit
bsl10 joined the channel
PaulN joined the channel
bsl10 has quit
bayman
when should you start a new app in your project?
bsl10 joined the channel
blackcross
when the models are > 5
FunkyBob
when you're starting a new topic
riclima joined the channel
bayman
if posting blog is one app, should user profile, messaging and newsfeed be another app?
FunkyBob
blog, usres, messaging, news... could each be separate apps