The parent object knows about all it's children. Each parent instance
has a 'manager' for the set of children, like
parent_instance.mychildren_set.
More exactly:
activity = Activity.objects.get(id=someid)
activity_parts = activity.activitypart_set.all() # you can use .filter
() etc.
And I'm not
It doesn't work if you set up the list_select_related option
explicitly in the ModelAdmin
for Page?
Or if you add the foreign key field to the list_display list.
http://docs.djangoproject.com/en/dev/ref/contrib/admin/
Also have you tried just setting select_related() first, without any
field opt
To be honest I don't really see why you would need multiple user
profile models,
instead of having one user profile model, and each entry would define
a different
user profile.
Of course I don't know the full details/requirementes of your project,
and what exactly you are
trying to do ... but I c
Hi Steven,
You can use the django-test-utils app, more specifically it's
"makefixture" command, then you can just dump a single model instance
if you want. Or a subset of model instances.
You can see it here:
http://github.com/ericholscher/django-test-utils/blob/master/test_utils/management/comman
Hi Sebastian,
I suppose you are trying to do something like this?
class CustomAttributes(models.Model):
name = models.CharField(max_length=30)
value = models.CharField(max_length=50)
class ObjectWithCustom(models.Model):
name = models.CharField(max_length=30)
attributes = models.
Hi Henrik,
What are your exact requirements? Is it sufficient if you could simply
translate all your tag instances (in every language you have basically
the same tags for the same entry, except translated)?
Or you need to be able to have possibly completely different tags for
the same model insta
Hi Patrick,
It *does* support this as far as I know. I've tried/used similar
queries and it works ok, although ofc not with your models.
Please post your model definitions for CitlData and Installation, to
see if there's any issue there.
Also what version of Django are you using?
Best Regards,
B
Just a quick idea off the top of my head before going to bed :)
def save(self, *args, **kwargs):
super(MyModel, self).save(*args, **kwargs) # Call the "real"
save() method.
timestamp = os.path.getmtime(self.my_image_field.path)
if datetime.datetime.now() - timestamp < VERY_
Even if we ignore the infinite loop, selecting and updating every
single instance of Subject at every save() of a Subject, is horribly
wrong and inefficient on many levels.
Exactly what kind of functionality/logic were you trying to implement?
On Mar 10, 10:32 pm, Ali Rıza Keleş wrote:
> Hi all,
Or more specifically, why exactly do you want to reorder them all at
every Subject .save()? And what exactly do you use the values in
'order' field for?
On Mar 10, 11:46 pm, Beres Botond wrote:
> Even if we ignore the infinite loop, selecting and updating every
> single instan
You cannot directly register a form with admin, you should be
registering models
from myapps.forms import MyModelForm
from myapps.models import MyModel
class MyModelAdmin(admin.ModelAdmin):
form = MyModelForm
admin.site.register(MyModel, EmailAdmin)
Also the form should be a ModelForm for
Please copy and paste here the Model definitions for Recept,
ingredient and 'verhouding' (I'm assuming this is explicitly defined,
given the non-standard name)
On Mar 10, 11:07 am, Marout wrote:
> Hi there,
>
> I'm relatively new tio django and I can't get to grips with my many-to-many
> relation
12 matches
Mail list logo