Re: top-level model

2006-01-08 Thread Roberto Aguilar
Alice, I think our problems are the same, just that you are looking at it from the left side and I'm looking from the right. ;) In fact, I was so confused when you replied to the one-to-one post as I thought you were replying to me! """ This relationship has been modelled as a one-to-one, but

Re: one-to-one design problem

2006-01-08 Thread Roberto Aguilar
I asked a very similar question to this one yesterday and Alice has replied: http://groups.google.com/group/django-users/browse_thread/thread/0350bdceec7d52d0/54af4cff81b20b32#54af4cff81b20b32 Please take a look at my reply in that post. I think both topics are awefully similar, should we simpl

BigIntegerField type?

2006-01-27 Thread Roberto Aguilar
Hello, I'm in need to store really big numbers in the database. It looks like the only limitation to this is that there is no BigIntegerField type to use. I found this bug, which covers the problem: http://code.djangoproject.com/ticket/399 But in the mean time, is the best thing to do simply

Re: glitches in admin interface

2006-01-29 Thread Roberto Aguilar
On 1/21/06, Luke Skibinski Holt <[EMAIL PROTECTED]> wrote: > > It seems my problem with the repeating fields is a known bug with > one-to-one relationships (http://code.djangoproject.com/ticket/1245) I just updated that ticket. I have a hunch that it's a matter of adding a join clause that joins

Using Foreign key attributes in a template

2006-01-29 Thread Roberto Aguilar
I have a Journal model that has a OneToOneField linking to a Blurb model (blurbs have title, text, author, etc.). In a template i do the following to get to the blurb attributes: {{ entry.get_blurb.get_author.username }} {{ entry.get_blurb.title }} {{ entry.get_blurb.text }} etc. is there a way

Re: Using Foreign key attributes in a template

2006-01-29 Thread Roberto Aguilar
On 1/29/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 1/29/06, Roberto Aguilar <[EMAIL PROTECTED]> wrote: > > is there a way to say something like: > > > > {% set blurb entry.get_blurb %} > > > > and then just use: > > &g

Re: image field update impossible.

2006-01-29 Thread Roberto Aguilar
Is it possible to attach a validator to that field and remove the file if it exists? Check out unlink on this page: http://docs.python.org/lib/os-file-dir.html -berto. On 1/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > It doesn't solve the problem, i can't still override the image wi

Re: What is save to use in __repr__

2006-01-30 Thread Roberto Aguilar
I ran into the same thing in a model with a ForeignKey to an auth.User object. In my __repr__ function I had: self.get_user() which would crash Django. In this instance, I wanted the username specifically, so I resorted to using: self.get_user().username I didn't try, but I think this would

Re: Extending User

2006-01-30 Thread Roberto Aguilar
I've done this with the latter approach. I made a person model that had more person-specific information and made the user field a foreign key and added the edit_inline option to have the information right there in the user interface: user = meta.ForeignKey(auth.User, edit_inline=meta.STACKED, n

Re: Question About Multi Column Keys

2006-01-31 Thread Roberto Aguilar
Aany "model" can be included in the admin interface as long as you include a META subclass inside of it with the admin attribute defined: class Tagged(meta.Model): user = meta.ForeignKey(User) site = meta.ForeignKey(Site) tag = meta.ForeignKey(Tag) class META: admin=meta.Adm

Re: How to use non English characters in templates

2006-02-07 Thread Roberto Aguilar
Just a shot in the dark, but is your database set for UTF-8? It may be that the text isn't being saved as international in the database, so when you retrieve it, it's just plain ascii. Here is a list of character sets supported: http://www.postgresql.org/docs/8.1/interactive/multibyte.html and

Re: How to identify svn revision of a released version?

2006-02-07 Thread Roberto Aguilar
You can download one of the tags: http://code.djangoproject.com/svn/django/tags/releases/ -berto. On 2/7/06, Hwan <[EMAIL PROTECTED]> wrote: > > hi, > which svn revision matches the released django-0.91? > where can i find this kind of information? > thanks > >

memcached + multiple virtual hosts

2006-02-09 Thread Roberto Aguilar
Hello, I'm planning on running multiple websites on one server using virtual hosts. I also want to run memcached and wanted to know what the best way to avoid "name collisions". Would the right thing to do be run multiple instances of memcached on different ports, or does memcached somehow acco

is_member_of method for user objects

2006-02-10 Thread Roberto Aguilar
Hello, I wasn't able to find an easy way to check if a user is a member of a group, so I added the method; here is a patch for: django/django/models/auth.py Index: auth.py === --- auth.py (revision 2296) +++ auth.py (workin

Re: is_member_of method for user objects

2006-02-11 Thread Roberto Aguilar
In my situation, what I wanted to do was limit the display of a bunch of menu items depending on the group of the user. I accomplished this with a for loop and a test for a group: {% for group in user.get_list %} {% ifequal group 'desired_group' %} [...] It's a two-step process rather than one,

Is context variable 'user' automatic in templates?

2006-02-11 Thread Roberto Aguilar
Hello, I've noticed that in certain instances, in a flatpage, for example, the user context variable is available in my templates. However, most of the time I have to explicity provide it like when using render_to_response. Is this a bug, feature, or am I just not doing something right? Thanks

Class Methods in Model?

2006-02-14 Thread Roberto Aguilar
Hello, I have a model called Invitation that I would like to have a method called make_rsvp_code. In the model I define it as such: class Invitation(meta.Model): [...] def make_rsvp_code(self, invitation): [...] make_rsvp_code = classmethod(make_rsvp_code) The reason I pas

Re: Class Methods in Model?

2006-02-14 Thread Roberto Aguilar
Awesome, works great. Thanks for the help, guys! -berto. On 2/14/06, James Bennett <[EMAIL PROTECTED]> wrote: > > On 2/14/06, Eric Walstad <[EMAIL PROTECTED]> wrote: > > Hey Berto, > > > > > > And magic-removal, as far

Edit a FK object from w/in view

2006-02-15 Thread Roberto Aguilar
Hello, I have a Model that has a FK to an Address Model. In the admin, I get a pulldown to select the address or a plus sign to add a new one. Is there some way to get an edit button next to the plus sign so that i can get the same window as the add window, but it's pre-filled with the address

Re: Edit a Foreign Key object from within a view

2006-02-16 Thread Roberto Aguilar
/path/to/related_object_editing.patch Please let me know if anyone finds any bugs with it. Is there any chance this will get incorporated into the main code base? I think it's a very useful feature, hopefully others will too. -berto. On 2/15/06, Roberto Aguilar <[EMAIL PROTECTED]> wrote: > Hello, &

Re: Edit a Foreign Key object from within a view

2006-02-16 Thread Roberto Aguilar
return HttpResponseRedirect("../") Index: templates/widget/foreign.html =========== --- templates/widget/foreign.html (revision 2296) +++ templates/widget/foreign.html (working copy) @@ -5,4 +5,5 @@ {% else %} {% if bou

Adding a list filter that points to a function?

2006-02-17 Thread Roberto Aguilar
Hello, In a person model I keep track of a person's address. I wanted to add a list filter, has_address, that shows yes or no depending on if the person has an address listed. I added 'has_address' to the list_filter tuple, but it just crashes the page. I added a column for has address as list

Re: Adding a list filter that points to a function?

2006-02-17 Thread Roberto Aguilar
Thanks for the reply! Here is the pertinent part of the code: http://django.pastebin.com/560781 I think it has more that has_address is a function and not a variable in the model. -berto. On 2/17/06, James Bennett <[EMAIL PROTECTED]> wrote: > > On 2/17/06, Roberto Aguilar <[