django tutorial stuck -


So I'm doing tutorials on DJ Practical Projects and came very far.

I have this code:

  def get_absolute_url (auto): return ('coltrane_entry_detail', (), {'year': self.pub_date.strftime (" Get_absolute_url = models.permalink (get_absolute_url)    / east > 

I get an indentation error

If I get a work / weblog / url but I want indent, but if I click on the "read more" link then I always have a Only place the pages on the page / weblog / and not / weblog / date / article. / P>

If you know the tutorial, then you may know the error if there are not all files here:

url project:

  from django.conf. Urls.defaults import * from myproject.views import * from django.views.generic.simple import direct_to_template import django.contrib import administrator admin.autodiscover () urlpatterns = patterns ( '', #Coltrane project Uarelpatns: (R ' Search / $ ',' MyProject.search.views.search '), (R' weblog / $ ', included (' coltrane.urls')),  

url callton: < / H1>
  from django.conf.urls.defaults import * to coltrane.models import entry entry_info_dict = {'queryset': Entry.objects.all (), 'date_field': 'pub_date',} # Coltrane Project URLparts: urlpatterns = Pattern ('django.views.generic.date_based', (R '^ $', 'Archive_In Dax, Prvishti_info_dikt, 'coltrane_entry_ Archive_index'), (r '^ (? P & lt; year & gt; \ d {4}) / $', 'Puralek_yuar, Prvishti_info_dikt,' Coltrane_entry_archive_year '), (r' ^ (? P & lt; year & gt; \ d {4}) / (? P & lt; month & gt; \ w {3}) / $ ',' archive_moth ', entry_info_dict,' coltrane_entry_archive_month '), (r '^ (? P & LT; Years & gt; \ D {4}) / (? P & lt; months & gt; \ w {3}) / (? P & lt; days & gt; \ d {2}) / $ ',' Archive_day ', entry_info_dict, 'Coltrane_entry_archive_day'), (R '^ (? P & lt; years & gt; \ d {4}) / (? P & lt; month & gt; \ w {3}) / (? P & lt; d & Gt; \ d {2}) / (? P  

Model:

  tag Tagging Tagging from the field category. Import TagFold class category (models.Model): title = models.CharField (max_length = 250, help_text = 'max 250 characters.)) Slug = models.SlugField (unique = true, help_text =' this is a small name that was created Must be exclusive! ') Description = Model TextField () class meta: ordering = ['title'] verbose_name_plural = "categories" def __unicode __ (self): return self. Taitel def get_absolute_url (self): return "/ categories /% S /"% self.slug class entry (models.Model): LIVE_STATUS = 1 DRAFT_STATUS = 2 HIDDEN_STATUS = 3 STATUS_CHOICES = ((LIVE_STATUS, 'Live'), (DRAFT_STATUS , 'Draft'), (HIDDEN_STATUS, 'hidden'),) # field field title = models.CharField (max_length = 250, help_text = 'max 250 characters.') Excerpt = models.TextField (empty = true, help_text = ' A short summary of the entry. Optional! ') Body = models.TextField () Pub_date = models.DateTimeField (default = datetime.datetime.now) # Fields to store the generated HTML Excerpt_html = models.TextField (editable = false , Empty = true) b Ody_html = Model Textfield (editable = false, empty = true) # Metadata author = model. Forwardkey (user) enable_comments = models.BooleanField (default = true) Featured = Models.BooleanField (default = False) slug = model. Slgfild (Anuti_for_deta = 'Pb_det') position = Modlkitegrfild (base = status = Chekoi, default = LIVE_STATUS, help_text = "just live with the status entries will be publicly displayed") # classification categories = model. Many Metafile (category) tag = Tagfild (Help_text = "Separate tags with spaces.") Class Meta: ordering = [ 'pub_date'] verbose_name_plural = "entries" def __unicode __ (self): return self.title def save ( Self, force_insert = False, force_update = False): self.body_html = markdown (self.body) if self.excerpt: self.excerpt_html = markdown (self.excerpt) super (insertion, self). Save (force_insert, force_update) def Get_absolute_url (self): return ( 'coltrane_entry_detail', (), { 'old' S Elf.pub_date.strftime ( "% Y"), 'month': self.pub_date.strftime ( " ('% D'), 'Slug': self.slug}) get_absolute_url = models.permalink (get_absolute_url)  

See the comments above, I got my error. I think the only way to stop my own question is to answer this .


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -