Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest presentation form added #72

Closed

Conversation

hayatbayramolsa
Copy link

Sunum önerisi oluşturma formu eklendi.

@@ -112,6 +112,8 @@
'people',
'presentations',
'blog',

'suggestpresentation',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bunu yeni bir app yerine presentations app'i altına alabiliriz.

@@ -0,0 +1,18 @@
from django.db import models

# Create your models here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Bu yorumu uçurabiliriz.


# Create your models here.

class suggest(models.Model):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest -> Suggest

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion daha mi iyi olur ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bence de Suggestion daha iyi.

# Create your models here.

class suggest(models.Model):
name = models.CharField(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeni kodda hanging indentation kullansak daha iyi olur bence:

name = models.CharField(
    max_length=255,
    verbose_name='Ad ve Soyad',
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Birde kod icinde turkce bisi kullanmayip translation ile mi cevirsek acep ya 😄Basima bisi gelmicek ise kod icinde turkce yazilmis bisi gormek hosuma gitmiyor.

verbose_name='Ad ve Soyad')
email = models.EmailField(
max_length=255,)
content = models.TextField(verbose_name="Öneriniz")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Çift veya tek tırnak arasında bir tercihim yok ama bütün kodda ikisinden birini tutarlı olarak kullansak daha iyi olur.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring harici çift tırnak kullanmıyorum :)

from django.views.generic import CreateView
from .models import suggest

# Create your views here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Bu yorumu da uçurabiliriz.

class CreateSuggestPresentation(CreateView):
model = suggest
form_class = suggestPresentationForm
success_message = "Öneriniz başarıyla iletildi."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buraya "X gün içerisinde geri dönüş yapılacak." gibi bir şey de eklesek mi acaba? @samet @halilkaya

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Olur. "3 gün içerisinde değerlendirilip sizinle irtibata geçilecektir." gibi bir sey diyebiliriz.


def form_valid(self, form):
messages.success(self.request, self.success_message)
return super(CreateSuggestPresentation, self).form_valid(form)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super().form_valid(form)


def get_success_url(self):
return reverse("suggestpresentation:index")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Bu boş satıra gerek yok.

success_message = "Öneriniz başarıyla iletildi."

def form_valid(self, form):
messages.success(self.request, self.success_message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bu pattern'ı halihazırda başka yerlerde de kullanıyoruz. Bence bunu mixin haline getirip diğer applerde de kullanabiliriz. Bunu bu PR içinde yapmaya gerek yok. Ayrı bir issue açacağım.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Açtım: #73

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bu mixin eklendi: 6d02fc5

Bu branch'i rebase edip mixin'i kullanırsak güzel olur.

from django import forms
from .models import suggest

class suggestPresentationForm(forms.ModelForm):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bu da SuggestPresentationForm olsa daha iyi olur.

from django.apps import AppConfig


class SuggestpresentationConfig(AppConfig):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Burasi da SuggestPresentationConfig olsa daha iyi olur.

@@ -38,6 +38,7 @@ <h1 id="logo" class="title">
<li><a href="/hakkimizda/">nedir?</a></li>
<li><a href="{% url "presentations:index" %}">sunumlar</a></li>
<li><a href="{% url "people:index" %}">insanlar</a></li>
<li><a href="{% url "suggestpresentation:index" %}">sunum önerisi</a></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sunum onerisi icin ayri bir menu eklemek yerine sunumlar sayfasinin icine bir button olarak eklesek daha iyi olmaz mi?

@@ -38,6 +38,7 @@ <h1 id="logo" class="title">
<li><a href="/hakkimizda/">nedir?</a></li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard-coded url kullanılmasa iyi olur

@ulgens ulgens force-pushed the cleanup branch 16 times, most recently from d14fcad to b3b2a9a Compare October 4, 2020 23:12
@ulgens ulgens closed this Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants