Use different forms for adding, changing, listing a model

2011-06-24 Thread Eiji Kobayashi
Hm... I asked a question similar to this, but no one responded :( But I think I over complicated the problem. Maybe I'll try simpler way. Suppose I have two models: 1) default Django user model 2) a simple custom model like this: class RegistrationQueue(models.Model): user = models.ForeignKey

Re: Newbie question, I'm having difficulty getting the admin panel to work!

2011-06-24 Thread Eiji Kobayashi
Ah, yes. You may be right. It may be a simple problem with a simple answer. Maybe I just over complicated things with too much words and explanation. Eiji On Fri, Jun 24, 2011 at 6:11 PM, Nan wrote: > > The sporadicness may have to do with the way it's being served -- that > happens to me when

Re: Newbie question, I'm having difficulty getting the admin panel to work!

2011-06-24 Thread Eiji Kobayashi
Hi Rishi, STATIC_ROOT, STATIC_URL, etc. are somewhat new additions to Django. I have troubles with the documentation myself because the new ones describing them are in English :). But I think everything that they considered static - javascript, css, img, and other media were to be inside a directo

Re: Django password_change

2011-06-23 Thread Eiji Kobayashi
Hi, Maybe you made a mistake, but your url says /account/password/change, but you put the password*.html files to /templates/registration. Shouldn't it be inside your project's templates/account directory? Maybe that is why you're getting a 404? Just a guess Eiji On Thu, Jun 23, 2011 at 11:53 A

Re: Newbie question, I'm having difficulty getting the admin panel to work!

2011-06-23 Thread Eiji Kobayashi
Hello, I'm not exactly sure about your other problems, but the problem with not getting any styles seem to me like you didn't set your ADMIN_MEDIA_PREFIX correctly in your settings file and/or your web server configuration file. You must let it know how to access all the javascript, css and image

Using multiple forms to manage a model under admin

2011-06-21 Thread Eiji Kobayashi
Hello, I have a question for all you django wizards. I want to use different forms for managing a model in Django's admin. I thought it's common problem, but I cannot find a good solution even after reading through google, stackoverflow and django's source code. (My apologies if this is a often as

Re: MEDIA and STATIC in a nutshell?

2011-05-15 Thread Eiji Kobayashi
Shawn, Thank you. For the compliment and your help. I'll try putting the static folder in my apps and try. Yes, the Japanese documentation is still stuck in 1.0, but there are other places to look. But I often use the English docs as last resort, because the language is so difficult for us. I hav

Re: MEDIA and STATIC in a nutshell?

2011-05-14 Thread Eiji Kobayashi
Thanks Shawn, I didn't read the documentation as thoroughly as I should have. And I know that I should read the English version rather than relying on the outdated, Japanese version. But this is good, as I need to learn English more. I modified the urls.py according to the docs, and the MEDIA_URL,

Re: MEDIA and STATIC in a nutshell?

2011-05-14 Thread Eiji Kobayashi
Exactly. Perhaps we should just ignore MEDIA and STATIC variable setup in the settings file altogether. When I couldn't get the variables to work like how I thought they should work, I just put the following stuff in the Apache vhost config file: Alias /media /Users/eiji/Sites/assets/media Alias

MEDIA and STATIC in a nutshell?

2011-05-13 Thread Eiji Kobayashi
Hi Everyone, This may seem like a very stupid question, but what exactly is the difference between MEDIA and STATIC? I read through the Django doc and it seems like STATIC is for css,js,img... etc., while MEDIA is for user uploaded files? But I'm confused because things do not work exactly like t

Re: Instantiate a model using a string (or a dict)??

2011-05-08 Thread Eiji Kobayashi
7;xyz123'} > # then > new_user = User(**params) > new_user.save() > # or > User.objects.create(**params) > > On Sun, May 8, 2011 at 1:44 PM, Eiji Kobayashi wrote: > >> Hi! >> >> Sorry. Another question, please. >> >> Is it possible to cre

Instantiate a model using a string (or a dict)??

2011-05-08 Thread Eiji Kobayashi
Hi! Sorry. Another question, please. Is it possible to create a model instance using a string parameter? Example, I would like to be able to do something like: param = "username='admin', email='x...@xyz.com', password='xyz123'" new_user = User(param) Of course this won't work. But is there a s

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-08 Thread Eiji Kobayashi
On Sun, May 8, 2011 at 12:00 AM, Oleg Lomaka wrote: > You have started from the beginning. Take a look at my very first reply in > this thread. Remove 'areacode' and 'number' fields from your MemberAdmin. > Let them be available from PhoneInline and AddressInline. You will be see > them on the sa

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Eiji Kobayashi
you can create a > function in your Member model to format phone fields into string and include > it in a list_display. Example > > # models.py > class Member(User): >   middle_name = models.CharField(max_length=20) > >   def all_phones(self): >     retur

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Eiji Kobayashi
ne ] >     fieldsets = ( >         (None, { >                 'fields': ( 'username', 'first_name', 'middle_name', > 'last_name') >                 }), >         ) > > admin.site.register(Member, MemberAdmin) > > On Sat, May 7, 2011 at 10:44 AM,

Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Eiji Kobayashi
Hi! I'm having trouble figuring out what to do. I have multiple models linked together using foreignkey, like the following: # models.py class Member(User): middle_name = models.CharField(max_length=20) class Phone(models.Model): owner = models.ForeignKey(Member) areacode = models.CharFiel