summaryrefslogtreecommitdiff
path: root/app/posts/importer.py
blob: 53a84aaf377baf6f0f37aeef2d3ef61aec2b152d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
for e in essaysold:
    if e.featured_image:
        feat = e.featured_image
    else:
        feat = None
    if e.meta_description:
        meta = e.meta_description
    else:
        meta = "need meta"
    new, created = Post.objects.get_or_create(
        old_id=e.pk,
        post_type=2,
        title=e.title,
        subtitle=e.sub_title,
        dek=e.dek,
        slug=e.slug,
        prologue_markdown=e.preamble,
        body_markdown=e.body_markdown,
        pub_date=e.pub_date,
        enable_comments=e.enable_comments,
        status=e.status,
        meta_description=meta,
        originally_published_by=e.originally_published_by,
        originally_published_by_url=e.originally_published_by_url,
        featured_image=feat,
        has_video=e.has_video,
        epilogue_markdown=e.afterword,
    )
    print(created)