Re: django noob question

2012-01-27 Thread adj7388
et. I hope that makes sense without giving examples of all the queries. This is just one way to do what I think you're trying to do. It may not be the best way. But hopefully it gives you some ideas about how to use Django models. Alan On Jan 27, 4:03 pm, adj7388 wrote: > Without knowing

Re: django noob question

2012-01-27 Thread adj7388
Without knowing your problem domain, you might want to start off with: class League(models.Model): name = models.CharField(max_length=200) class Team(models.Model): name = models.CharField(max_length=200) league = models.ForeignKey(League) Generally you don't want a model with a plur

Re: how to define choices option per model's instance

2010-12-02 Thread adj7388
Here is an approach I have used. I can't tell from your question whether this will help you or not. class AccountEntryModelForm(ModelForm): def __init__(self, organization=None, operation=None, *args, **kwargs): super(ModelForm, self).__init__(*args, **kwargs) self.organizatio

Re: django-registration question: activation_key_expired.boolean = True

2010-10-31 Thread adj7388
> This particular object is used by the admin: > > http://docs.djangoproject.com/en/1.2/ref/contrib/admin/#django.contri... > > Read through that carefully and you'll see the 'boolean' option and a > few other useful tricks. Well, this is embarrassing. I had actually read (err, skimmed?) that page

django-registration question: activation_key_expired.boolean = True

2010-10-31 Thread adj7388
This question refers to line 205 here: http://bitbucket.org/ubernostrum/django-registration/src/b6b213d84d32/registration/models.py In a nutshell: class RegistrationProfile(models.Model): def activation_key_expired(self): ... expiration_date = datetime.timedelta(days=settings.ACC

Re: User.get_profile() not working

2010-09-29 Thread adj7388
Still learning. Always learning. I guess I learn best when I break stuff and do dumb things. Thanks to all who replied for the great advice and tips. -- 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

Re: User.get_profile() not working

2010-09-28 Thread adj7388
Good grief. After spending hours trying to figure out what was wrong, I immediately found the problem after making this post. Here's the solution: I had overridden UserProfile.__init__() like this: class UserProfile(models.Model): def __init__(self, website='http://www.default.com'): while i

User.get_profile() not working

2010-09-28 Thread adj7388
Django newbie issue. Just trying to understand. I'm setting up a simple UserProfile class to link to User (as described in several places in documentation). Here's what I have --- a simple example of storing the user's website in a profile #In myapp/models.py class UserProfile(models.Model): d