-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a match of the AnalyzedURL, but tracking ads against a specific advertiser. This is the first step in doing targeting based on embedding data, is to keep track of analyzed ad data.
- Loading branch information
1 parent
3202a68
commit 8aef840
Showing
8 changed files
with
241 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# Generated by Django 4.2.11 on 2024-03-14 21:03 | ||
import django.db.models.deletion | ||
import django_extensions.db.fields | ||
import jsonfield.fields | ||
from django.db import migrations | ||
from django.db import models | ||
|
||
import adserver.analyzer.validators | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("adserver", "0093_publisher_ignore_mobile_traffic"), | ||
("adserver_analyzer", "0005_remove_embedding"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="AnalyzedAd", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"created", | ||
django_extensions.db.fields.CreationDateTimeField( | ||
auto_now_add=True, verbose_name="created" | ||
), | ||
), | ||
( | ||
"modified", | ||
django_extensions.db.fields.ModificationDateTimeField( | ||
auto_now=True, verbose_name="modified" | ||
), | ||
), | ||
( | ||
"url", | ||
models.URLField( | ||
db_index=True, | ||
help_text="URL of the page being analyzed after certain query parameters are stripped away", | ||
max_length=1024, | ||
), | ||
), | ||
( | ||
"keywords", | ||
jsonfield.fields.JSONField( | ||
blank=True, | ||
null=True, | ||
validators=[adserver.analyzer.validators.KeywordsValidator()], | ||
verbose_name="Keywords for this URL", | ||
), | ||
), | ||
( | ||
"last_analyzed_date", | ||
models.DateTimeField( | ||
blank=True, | ||
db_index=True, | ||
default=None, | ||
help_text="Last time the ad server analyzed this URL", | ||
null=True, | ||
), | ||
), | ||
( | ||
"last_ad_served_date", | ||
models.DateField( | ||
blank=True, | ||
default=None, | ||
help_text="Last date an ad was served for this URL", | ||
null=True, | ||
), | ||
), | ||
( | ||
"visits_since_last_analyzed", | ||
models.PositiveIntegerField( | ||
default=0, | ||
help_text="Number of times ads have been served for this URL since it was last analyzed", | ||
), | ||
), | ||
( | ||
"ad", | ||
models.ForeignKey( | ||
help_text="Ad with the URL", | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="adserver.advertisement", | ||
), | ||
), | ||
], | ||
options={ | ||
"unique_together": {("url", "ad")}, | ||
}, | ||
), | ||
migrations.DeleteModel( | ||
name="HistoricalAnalyzedUrl", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 4.2.11 on 2024-03-14 21:27 | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("adserver", "0093_publisher_ignore_mobile_traffic"), | ||
("adserver_analyzer", "0006_add_analyzedad"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="analyzedad", | ||
old_name="ad", | ||
new_name="advertisement", | ||
), | ||
migrations.AlterUniqueTogether( | ||
name="analyzedad", | ||
unique_together={("url", "advertisement")}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Generated by Django 4.2.11 on 2024-03-14 21:45 | ||
import django.db.models.deletion | ||
from django.db import migrations | ||
from django.db import models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("adserver", "0093_publisher_ignore_mobile_traffic"), | ||
("adserver_analyzer", "0007_rename_ad"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterUniqueTogether( | ||
name="analyzedad", | ||
unique_together=set(), | ||
), | ||
migrations.AddField( | ||
model_name="analyzedad", | ||
name="advertiser", | ||
field=models.ForeignKey( | ||
default=1, | ||
help_text="Advertiser with the URL", | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="adserver.advertiser", | ||
), | ||
preserve_default=False, | ||
), | ||
migrations.AlterUniqueTogether( | ||
name="analyzedad", | ||
unique_together={("url", "advertiser")}, | ||
), | ||
migrations.RemoveField( | ||
model_name="analyzedad", | ||
name="advertisement", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters