Skip to content

Commit

Permalink
Merge pull request #30 from StackTipsLab/feature/improve-blog-posts
Browse files Browse the repository at this point in the history
Removed is_redirect
  • Loading branch information
nilandev authored Nov 17, 2023
2 parents e81922a + 1ac00af commit 4e5198d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 49 deletions.
1 change: 0 additions & 1 deletion bloggy/admin/misc_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ class RedirectRuleAdmin(admin.ModelAdmin):
'source',
'destination',
'status_code',
'is_regx',
'note',
)
3 changes: 1 addition & 2 deletions bloggy/management/commands/seed_redirectrules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def handle(self, *args, **options):
from_url=row[0],
to_url=row[1],
status_code=row[2],
is_regx=row[3],
note=row[4]
note=row[3]
)

self.stdout.write(self.style.SUCCESS(f"%s redirect rules imported" % counter))
17 changes: 17 additions & 0 deletions bloggy/migrations/0004_remove_redirectrule_is_regx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.7 on 2023-11-17 16:54

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('bloggy', '0003_rename_logo_category_thumbnail_page_thumbnail'),
]

operations = [
migrations.RemoveField(
model_name='redirectrule',
name='is_regx',
),
]
6 changes: 0 additions & 6 deletions bloggy/models/redirect_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ class RedirectRule(Updatable):
help_text="Redirect type",
verbose_name="Redirect type")

is_regx = models.BooleanField(
default=False,
null=True,
help_text="Is this regx?"
)

note = models.CharField(
max_length=500,
help_text='Enter note',
Expand Down
51 changes: 11 additions & 40 deletions demo_content/redirect_rules.csv
Original file line number Diff line number Diff line change
@@ -1,40 +1,11 @@
source,destination,status_code,is_regx,note
/tutorials/spring/how-to-configure-pojos-with-java-collection-attributes,/articles/configure-pojos-with-java-collection-attributes-in-spring,301,True,
/android/download-and-display-image-in-android-gridview,/articles/download-and-display-image-in-android-gridview,301,True,
/article/how-to-format-your-post,/how-to-format-your-post,301,True,
/android/android-framelayout-example,/articles/android-framelayout-example,301,True,
/interview-questions,/articles,301,True,
/courses/maven,/courses/maven-for-beginners,301,True,
/how-to-format-your-post,/contribute,301,True,
/article/download-and-display-image-in-android-gridview,/articles/download-and-display-image-in-android-gridview,301,True,
/tutorials/java/spring/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/android/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/spring-boot/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/spring/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/laravel/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/php/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/git/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/html5/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/bootstrap/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/java/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/xamarin/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/react/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/react-native/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/wordpress/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/json/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/design-patterns/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/sencha-touch/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/ibm-worklight/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/phonegap/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/ios/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/seo/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/se-concepts/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/servlets/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/struts/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/c/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/struts/([a-zA-Z0-9-]+), /article/\1,301,False,
/tutorials/libgdx/([a-zA-Z0-9-]+), /article/\1,301,False,
/how-to/([a-zA-Z0-9-]+), /article/\1,301,False,
/blog/([a-zA-Z0-9-]+), /article/\1,301,False,
/articles/how-to-configure-pojos-with-java-collection-attributes,/articles/configure-pojos-with-java-collection-attributes-in-spring,301,True,
/courses/maven,/courses/maven-for-beginners,301,True,
source,destination,status_code,note
/tutorials/spring/how-to-configure-pojos-with-java-collection-attributes,/articles/configure-pojos-with-java-collection-attributes-in-spring,301,
/android/download-and-display-image-in-android-gridview,/articles/download-and-display-image-in-android-gridview,301,
/article/how-to-format-your-post,/how-to-format-your-post,301,
/android/android-framelayout-example,/articles/android-framelayout-example,301,
/interview-questions,/articles,301,
/courses/maven,/courses/maven-for-beginners,301,
/how-to-format-your-post,/contribute,301,
/article/download-and-display-image-in-android-gridview,/articles/download-and-display-image-in-android-gridview,301,
/articles/how-to-configure-pojos-with-java-collection-attributes,/articles/configure-pojos-with-java-collection-attributes-in-spring,301,
/courses/maven,/courses/maven-for-beginners,301,

0 comments on commit 4e5198d

Please sign in to comment.