So now, I'd like to do the following:
class AppConfig(models.Model):
my_content_type = ForeighnKey(ContentType)
wrote:
> Awesome -- thanks!
>
> On Mon, Sep 19, 2016 at 6:48 PM, Tim Graham wrote:
>
>> Do you know about https://docs.djangoproject.com
>> /en/stable/ref/contrib/contenttypes
Awesome -- thanks!
On Mon, Sep 19, 2016 at 6:48 PM, Tim Graham wrote:
> Do you know about https://docs.djangoproject.com/en/stable/ref/contrib/
> contenttypes/#generic-relations ?
>
>
> On Monday, September 19, 2016 at 12:30:01 PM UTC-4, Jonty Needham wrote:
>>
>> I want to have a model that has
Do you know about
https://docs.djangoproject.com/en/stable/ref/contrib/contenttypes/#generic-relations
?
On Monday, September 19, 2016 at 12:30:01 PM UTC-4, Jonty Needham wrote:
>
> I want to have a model that has a foreignkey to a model from another app.
> The app can be one of many.
>
> So f
I want to have a model that has a foreignkey to a model from another app.
The app can be one of many.
So far I've come up with a two field solution with:
model_type = ForeignKey(ContentType)
pk_field = PositiveIntegerField()
with an appropriate getter. Is there a better way to do this? It feels
4 matches
Mail list logo