Kaydet (Commit) 6f262d48 authored tarafından Batuhan Taşkaya's avatar Batuhan Taşkaya

Link model and feed user links

üst f8dce46b
# Generated by Django 2.2.1 on 2019-05-05 11:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('social', '0003_socialuser_avatar'),
]
operations = [
migrations.CreateModel(
name='Link',
fields=[
('sharable_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='social.Sharable')),
('url', models.URLField()),
],
bases=('social.sharable',),
),
]
......@@ -28,3 +28,6 @@ class Post(Sharable):
class Snippet(Sharable):
text = models.TextField()
class Link(Sharable):
url = models.URLField()
......@@ -11,7 +11,12 @@
<p><a href="{% url 'logout' %}">logout</a></p>
{% load renderer %}
{% for item in feed %}
<div>
<fieldset>
<legend><a href="{% url 'profile' item.author %}">{{ item.author }}</a></legend>
{% as_html item %}
</fieldset>
</div>
{% endfor %}
{% else %}
<p>You are not logged in</p>
......
<div>
<fieldset>
<legend>{{ item.author }}</legend>
<p> {{ item.text }} </p><br>
-- wrote this at {{ item.pub_date }};
</fieldset>
</div>
<p> {{ item.text }} </p><br>
<div>
<fieldset>
<legend>{{ item.author }}</legend>
<pre>
<pre>
<code class="python">
{{ item.text }}
</code>
</pre>
<br>
-- wrote this at {{ item.pub_date }};
</fieldset>
</div>
</pre>
......@@ -84,7 +84,7 @@ class PatternManager:
class SocialPatterns(PatternManager, UserList):
home = "", Home
user = "people/<slug>/", Profile
profile = "people/<slug>/", Profile
register = "accounts/register/", Register
includes = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment