to use a rich-text editor (NicEdit) instead of the plain
> memo box.
>
> Thanks!
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions
--
DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goog
Hi,
Is there a way to include additional JavaScript in the admin page for
a particular model? I don't want to touch the model code though.
The particular scenario is I want to change the flatpage edit screen
in the admin to use a rich-text editor (NicEdit) instead of the plain
memo box.
Thanks!
ut I noticed a new get_urls function on
> > the ModelAdmin class in the docs. I'm on trunk, and just did an svn
> > update to 9975 to try this out.
>
> > The docs for get_urls show the view being registered as self.view. Is
> > that possible to register a class m
attern. But I noticed a new get_urls function on
> > the ModelAdmin class in the docs. I'm on trunk, and just did an svn
> > update to 9975 to try this out.
>
> > The docs for get_urls show the view being registered as self.view. Is
> > that possible to register a c
On Mar 4, 9:11 pm, Brian Neal wrote:
> I'd like to make my own custom view. In the past I did this by
> following the django book and added a URL to my main urlpatterns above
> the '^admin/(.*)' pattern. But I noticed a new get_urls function on
> the ModelAdmin clas
I'd like to make my own custom view. In the past I did this by
following the django book and added a URL to my main urlpatterns above
the '^admin/(.*)' pattern. But I noticed a new get_urls function on
the ModelAdmin class in the docs. I'm on trunk, and just did an svn
update
wrote:
>
>
>
> > Alex,
>
> > I managed to get it to work, and the column is even sortable! Thanks
> > for your help.
>
> > Here's my code for reference for anyone else who comes across this
> > post:
>
> > class UserAdmin(admin.ModelAdmin):
>
&
dmin.ModelAdmin):
>
There are some extensions made to the default User ModelAdmin that you are
going to miss unless you base your customized class off of auth's provided
default UserAdmin. See:
http://code.djangoproject.com/ticket/8916#comment:14
That ticket notes that change password, for exam
heers,
> > > > Kevin
>
> > > > On Feb 16, 3:45 pm, Alex Gaynor wrote:
> > > > > On Mon, Feb 16, 2009 at 6:27 PM, Kevin Audleman <
> > > > kevin.audle...@gmail.com>wrote:
>
> > > > > > I've created a custom p
> kevin.audle...@gmail.com>wrote:
> >
> > > > > I've created a custom profile per the instructions in chapter 12 of
> > > > > the book to give my user's fields like address1, address2, etc.
> > > > > Currently when I log in to the a
e admin and want to update a user, I have
> > > > to go to two separate pages: the User page to update core user fields,
> > > > and the Profile page to update fields in the profiles.
>
> > > > I would like to overwrite the ModelAdmin for the User object and
>
t; Currently when I log in to the admin and want to update a user, I have
> > > to go to two separate pages: the User page to update core user fields,
> > > and the Profile page to update fields in the profiles.
> >
> > > I would like to overwrite the ModelAdmin
chapter 12 of
> > the book to give my user's fields like address1, address2, etc.
> > Currently when I log in to the admin and want to update a user, I have
> > to go to two separate pages: the User page to update core user fields,
> > and the Profile page to upda
go to two separate pages: the User page to update core user fields,
> and the Profile page to update fields in the profiles.
>
> I would like to overwrite the ModelAdmin for the User object and
> inline the Profile object so that all fields for a user can be edited
> from one page. Ho
le page to update fields in the profiles.
I would like to overwrite the ModelAdmin for the User object and
inline the Profile object so that all fields for a user can be edited
from one page. However django is throwing an error when I try to do
so:
AlreadyRegistered at /admin/
The model User
On Wed, Jan 21, 2009 at 4:37 PM, TeenSpirit83
wrote:
>
> I'm developing a little webapp starting from the contrib.admin
> at the moment i manage a class in the model with a modeladmin class
> but i need to edit the entries as a tabular inline of another class.
> if i write bot
I'm developing a little webapp starting from the contrib.admin
at the moment i manage a class in the model with a modeladmin class
but i need to edit the entries as a tabular inline of another class.
if i write both the inline and the modeladmin classes in admin.py and
try to register them
).__init__(self, *args, **kwargs)
...
self.fields['lastname'].initial = ...
On Jan 8, 3:14 am, Andy wrote:
> The better approach would be to specify a custom form in your
> ModelAdmin. This way your fieldset definition could include anything
> that's speci
The better approach would be to specify a custom form in your
ModelAdmin. This way your fieldset definition could include anything
that's specified in your custom form.
For Example:
class SampleModel(models.Model):
email = models.EmailField...
firstname = models.CharField...
Thanks Karen & Daniel,
I think your overiding approach will work. Thank you.
Implemented a work around. I added extra fields (that persist my
method information) to my model that I update and save when I do a
listing. Price I pay is an extra database update each time the model
is getting list
On Wed, Jan 7, 2009 at 11:45 AM, EagerToUnderstand wrote:
>
> What I try to achieve:
> I have a couple of model methods that exposes real time information.
> (Retrieved when method is called.) This is information I want to
> display not only in the list_display, but also within the change view.
>
..and
therefor not visible to the fieldsets field?
Still clear as mud?
On Jan 7, 5:48 pm, Daniel Roseman
wrote:
> On Jan 7, 10:35 am, EagerToUnderstand wrote:
>
> > I am referencing a self defined model method in list_display option of
> > ModelAdmin. I would like to
On Jan 7, 10:35 am, EagerToUnderstand wrote:
> I am referencing a self defined model method in list_display option of
> ModelAdmin. I would like to do the same in the fiedsets option of
> ModelAdmin, but I get an error saying my method is missing from the
> form when the page is r
I am referencing a self defined model method in list_display option of
ModelAdmin. I would like to do the same in the fiedsets option of
ModelAdmin, but I get an error saying my method is missing from the
form when the page is rendered. It seems to me I can only render
model methods with
Hello :) (sorry I'm French)
When I create a ticket (for a blog), I select various tags.
I would save these with the save_model and save_tagged_items methods
below :
class TicketAdmin(admin.ModelAdmin):
# ...
def save_model(self, request, ticket, form, change):
# Save the autho
Does anyone have a best-practice suggestion for ModelAdmins which are
best used with a preset list_filter? Put another way, where are the
best usability customization points so the user sees a specific list
filter when entering that modeladmin, and when being redirected after
various actions, but
In case anyone else is trying to figure out how to do this, the
solution I came up with was to put a dictionary of the values into the
request and pass it to the ModelAdmin add_view function
def some_view(request, ... ):
...
values = { 'title': t, 'author': a }
;: a }
4: admin = new ArticleAdmin()
5. ...
6: return admin.add_view(request)
Notes:
Line 4 - ArticleAdmin is a subclass of
django.contrib.admin.ModelAdmin
Line 6 - This method in ModelAdmin displays the standard admin
change_form
Is there a way to use the "values" dicti
Code above was a bit incorrect. Here better solution:
## widget declaration
from django.utils.safestring import mark_safe
from django.forms.widgets import FileInput
class AdminImageFieldWithThumbWidget(FileInput):
def __init__(self, thumb_width=50, thumb_height=50):
self.width = thum
Beauty in motion! Works like a charm...Thanks!
--~--~-~--~~~---~--~~
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,
I have written some sample.
it works for me, hope it will be usefull:
from django.contrib.admin.widgets import AdminFileWidget
from django.utils.safestring import mark_safe
class AdminImageFieldWithThumbWidget(AdminFileWidget):
def render(self, name, value, attrs=None):
thumb_html =
I think you need to write custom widget for ImageField
--~--~-~--~~~---~--~~
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 th
Hi,
I've been able to somewhat customize the admin page for a record by
using fieldsets and list_display.
Here's the thing though. I have an ImageField which I can show in
list_display (I copied/modified a thumb function) but I can't figure
out how to show the image in the fieldset. I know des
On Sep 8, 2:57 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Sep 8, 8:14 pm, KillaBee <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > I am editing my Admin.py to use the new ModelAdmin. All my change has
> > no effect. I wanted it to come up with all my ap
On Sep 8, 8:14 pm, KillaBee <[EMAIL PROTECTED]>
wrote:
> I am editing my Admin.py to use the new ModelAdmin. All my change has
> no effect. I wanted it to come up with all my app automaticlly.
>
> I have this in my urls.py:
> from django.contrib import admin
&g
It's in there the whole thing looks like this:
from django.conf.urls.defaults import *
from django.contrib import admin
#from intraweb.apps.timesheets.admin import basic_site, advanced_site
admin.autodiscover()
info_dict = {
'app_label': 'timesheets',
'module_name': 'entrys',
'date_field':
You need to add:
admin.autodiscover()
in your urls.py
Regards,
Martin
On Sep 8, 9:14 pm, KillaBee <[EMAIL PROTECTED]>
wrote:
> I am editing my Admin.py to use the new ModelAdmin. All my change has
> no effect. I wanted it to come up with all my app automaticlly.
>
>
I am editing my Admin.py to use the new ModelAdmin. All my change has
no effect. I wanted it to come up with all my app automaticlly.
I have this in my urls.py:
from django.contrib import admin
.
.
.
(r'^admin/(.*)', admin.site.root),
==
and m
Ivan Sagalaev wrote:
> fabio natali wrote:
> > For the sake of clarity, my django project is named arteak, the models
> > we are using belong to an app called "management".
>
> Ah! Then there should of course be get_model('management',
> kwargs.pop('model')). I thought 'arteak' was the name of t
fabio natali wrote:
> For the sake of clarity, my django project is named arteak, the models
> we are using belong to an app called "management".
Ah! Then there should of course be get_model('management',
kwargs.pop('model')). I thought 'arteak' was the name of the app. This
is why it returns N
Dear Ivan, it sounds like we are closer to the solution, still not got
it though.
Ivan Sagalaev wrote:
[...]
> > http://dpaste.com/72639/
>
> Oy! I've found it :-). It has nothing to do with model_view decorator or
> anything that we're talking here about. It's in urls.py, on line 30:
>
>
fabio natali wrote:
> That's right! So here comes my current urls.py:
>
> http://dpaste.com/72638/
>
> then the traceback I get at http://localhost:8000/:
>
> http://dpaste.com/72639/
Oy! I've found it :-). It has nothing to do with model_view decorator or
anything that we're talking here abo
Hi Ivan!
Ivan Sagalaev wrote:
[...]
> fabio natali wrote:
> > I added the line
> >
> > import arteak.management.models
>
> It's not the same thing :-). This line won't load the name "models" into
> your local environment. If you want import from some path this should be:
>
> from a
fabio natali wrote:
>> import models
>
> I added the line
>
> import arteak.management.models
It's not the same thing :-). This line won't load the name "models" into
your local environment. If you want import from some path this should be:
from arteak.management import models
Ivan Sagalaev wrote:
[...]
> fabio natali wrote:
> > KeyError at /manufacturer
> > u'manufacturer'
> > when accessing http://localhost:8000/manufacturer
>
> KeyError says that it can't find a key 'manufacturer' in dict
> model_classes. This leads me to think that model_classes is empty. It
> ca
fabio natali wrote:
> This is the urls.py I created: http://dpaste.com/72138/
> It doesn't work though: I get a
> KeyError at /manufacturer
> u'manufacturer'
> when accessing http://localhost:8000/manufacturer
> (manufacturer being one of my model)
KeyError says that it can't find a key 'manufact
Dear Ivan, your help is priceless, thanks!
Ivan Sagalaev wrote:
[...]
> In models.py you can get rid of repeating "Manufacturer" two extra times
> by doing:
>
> class Manufacturer(models.Model):
> name = models.CharField(max_length=30)
> address = models.CharField(max_len
Hi all,
Is there another way to get the ModelAdmin registered for a specific
Model than to access the _registry of the AdminSite instance.
Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
201 - 248 of 248 matches
Mail list logo