cat <ваш файл>| perl -e '$i=0;while(<>){my @count=/(\")/g; $i++; $im=scalar @count; if ($im%2!=0){print $i." ".$_."\n";}}'
51,"Неизвестно 1"
52,"Неизвестно 2"
53,"Неизвестно 3"
54,"Неизвестно 4
55,"Неизвестно 5"
56,"Неизвестно 6"
57,"Неизвестно 7
125,""
4 54,"Неизвестно 4
7 57,"Неизвестно 7
class Stack:
def __init__(self):
self.item = []
def push(self,item):
self.item.append(item)
def pop(self):
return self.item.pop()
def isEmpty(self):
return self.item==[]
def size(self):
return len(self.item)
def html(tag):
s = Stack()
for symbol in tag:
if symbol == "<":
s.push(symbol)
elif symbol == ">" and s.isEmpty():
return False
elif symbol == ">":
s.pop()
return True if s.isEmpty() else False
if __name__ == '__main__':
print(html('</html> </body> ,This is html! <body> </title> <title> </head> <head> <html>'))
print(html('<>title</>'))
print(html('</html> </body ,This is html! <body> </title> <title> </head> <head> <html>'))
print(html('>/html< </body> ,This is html! <body> </title> <title> </head> <head> <html>'))
from .views import PatientDetailView
...
url(r'patient/(?P<pk>\d+)/', PatientDetailView.as_view(), name='patient_detail'),
...
from django.views.generic import DetailView
from models import Patient
class PatientDetailView(DetailView):
model = Patient
from django.views.generic import DetailView
from .models import Patient
urlpatterns = [
...
url(r'patient/(?P<pk>\d+)/', DetailView.as_view(model=Patient), name='patient_detail'),
]
class Post (models.Model):
published_date = models.DateTimeField(blank=True, null=True, verbose_name='Дата публикации')
public = models.BooleanField(default=False, verbose_name='Опубликовано?')
def save(self, *args, **kwargs):
if self.public:
self.published_date = timezone.now()
else:
self.published_date = None
super(Post, self).save(*args, **kwargs)