Be sure to post the results back here for the archive so others may
find it in searches.
On Sun, Dec 1, 2013 at 8:32 AM, Aamu Padi wrote:
> Ok, I will try it! Thank you so very much!!!
>
>
> On Sun, Dec 1, 2013 at 3:41 AM, Timothy W. Cook wrote:
>>
>> On Sat, Nov 30, 2013 at 3:37 PM, Aamu Padi
Ok, I will try it! Thank you so very much!!!
On Sun, Dec 1, 2013 at 3:41 AM, Timothy W. Cook wrote:
> On Sat, Nov 30, 2013 at 3:37 PM, Aamu Padi wrote:
> > Yes!!! Can I use it as a string in template?
> >
>
>
> I haven't tested it but it seems you should be able to assign it to a
> context var
On Sat, Nov 30, 2013 at 3:37 PM, Aamu Padi wrote:
> Yes!!! Can I use it as a string in template?
>
I haven't tested it but it seems you should be able to assign it to a
context variable or kwargs in a view and use it in a template.
Something like:
context['classname'] = type(myinstance)
or
kwa
Yes!!! Can I use it as a string in template?
On Sat, Nov 30, 2013 at 2:45 PM, Timothy W. Cook wrote:
> You can use type() on your instance(s) to find out their model class.
>
> If you have an instance of the model:
>
> stream = StreamItem.objects.create(user,ct,oid,pdate)
>
> Then type(stream)
You can use type() on your instance(s) to find out their model class.
If you have an instance of the model:
stream = StreamItem.objects.create(user,ct,oid,pdate)
Then type(stream) should return
Is that what you wanted?
On Sat, Nov 30, 2013 at 1:14 AM, Simon Charette wrote:
> Do you want
Yes. Could you kindly please show me how?
On Sat, Nov 30, 2013 at 8:44 AM, Simon Charette wrote:
> Do you want to retrieve the class name of the model class associated with
> a content type?
>
> Le jeudi 28 novembre 2013 12:04:34 UTC-5, Aamu Padi a écrit :
>
>> How do I get the class name in str
Do you want to retrieve the class name of the model class associated with a
content type?
Le jeudi 28 novembre 2013 12:04:34 UTC-5, Aamu Padi a écrit :
>
> How do I get the class name in string of a ContentType? I tried it this
> way, but it didn't worked out:
>
> class StreamItem(models.Model):
How do I get the class name in string of a ContentType? I tried it this
way, but it didn't worked out:
class StreamItem(models.Model):
user = models.ForeignKey(User)
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
pub_date = models.DateTimeFi
8 matches
Mail list logo