use process_set for related name not processes

This commit is contained in:
Nick Sweeting
2025-12-30 12:55:23 -08:00
parent 1b49ea9a0e
commit ba8c28a866
4 changed files with 7 additions and 8 deletions

View File

@@ -664,7 +664,6 @@ const CHROME_ARGS_DEFAULT = [
'--window-position=0,0', '--window-position=0,0',
'--hide-scrollbars', // hide scrollbars because otherwise they show up in screenshots '--hide-scrollbars', // hide scrollbars because otherwise they show up in screenshots
'--install-autogenerated-theme=169,32,85', // red border makes it easier to see which chrome window is archivebox's '--install-autogenerated-theme=169,32,85', // red border makes it easier to see which chrome window is archivebox's
'--virtual-time-budget=60000', // fast-forward all animations & timers by 60s
'--autoplay-policy=no-user-gesture-required', // auto-start videos so they trigger network requests + show up in outputs '--autoplay-policy=no-user-gesture-required', // auto-start videos so they trigger network requests + show up in outputs
'--disable-gesture-requirement-for-media-playback', '--disable-gesture-requirement-for-media-playback',
'--lang=en-US,en;q=0.9', '--lang=en-US,en;q=0.9',

View File

@@ -351,7 +351,7 @@ class Snapshot(ModelWithOutputDir, ModelWithConfig, ModelWithNotes, ModelWithHea
def binary_set(self): def binary_set(self):
"""Get all Binary objects used by processes related to this snapshot.""" """Get all Binary objects used by processes related to this snapshot."""
from archivebox.machine.models import Binary from archivebox.machine.models import Binary
return Binary.objects.filter(process__archiveresult__snapshot_id=self.id).distinct() return Binary.objects.filter(process_set__archiveresult__snapshot_id=self.id).distinct()
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
is_new = self._state.adding is_new = self._state.adding

View File

@@ -249,9 +249,9 @@ class Migration(migrations.Migration):
('url', models.URLField(blank=True, default=None, help_text='Connection URL (CDP endpoint, sonic server, etc.)', max_length=2048, null=True)), ('url', models.URLField(blank=True, default=None, help_text='Connection URL (CDP endpoint, sonic server, etc.)', max_length=2048, null=True)),
('status', models.CharField(choices=[('queued', 'Queued'), ('running', 'Running'), ('exited', 'Exited')], db_index=True, default='queued', max_length=16)), ('status', models.CharField(choices=[('queued', 'Queued'), ('running', 'Running'), ('exited', 'Exited')], db_index=True, default='queued', max_length=16)),
('retry_at', models.DateTimeField(blank=True, db_index=True, default=django.utils.timezone.now, help_text='When to retry this process', null=True)), ('retry_at', models.DateTimeField(blank=True, db_index=True, default=django.utils.timezone.now, help_text='When to retry this process', null=True)),
('machine', models.ForeignKey(help_text='Machine where this process executed', on_delete=django.db.models.deletion.CASCADE, related_name='processes', to='machine.machine')), ('machine', models.ForeignKey(help_text='Machine where this process executed', on_delete=django.db.models.deletion.CASCADE, related_name='process_set', to='machine.machine')),
('binary', models.ForeignKey(blank=True, help_text='Binary used by this process', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='processes', to='machine.binary')), ('binary', models.ForeignKey(blank=True, help_text='Binary used by this process', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='process_set', to='machine.binary')),
('iface', models.ForeignKey(blank=True, help_text='Network interface used by this process', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='processes', to='machine.networkinterface')), ('iface', models.ForeignKey(blank=True, help_text='Network interface used by this process', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='process_set', to='machine.networkinterface')),
], ],
options={ options={
'verbose_name': 'Process', 'verbose_name': 'Process',

View File

@@ -510,7 +510,7 @@ class Process(ModelWithHealthStats):
Machine, Machine,
on_delete=models.CASCADE, on_delete=models.CASCADE,
null=False, null=False,
related_name='processes', related_name='process_set',
help_text='Machine where this process executed' help_text='Machine where this process executed'
) )
@@ -545,14 +545,14 @@ class Process(ModelWithHealthStats):
Binary, Binary,
on_delete=models.SET_NULL, on_delete=models.SET_NULL,
null=True, blank=True, null=True, blank=True,
related_name='processes', related_name='process_set',
help_text='Binary used by this process' help_text='Binary used by this process'
) )
iface = models.ForeignKey( iface = models.ForeignKey(
NetworkInterface, NetworkInterface,
on_delete=models.SET_NULL, on_delete=models.SET_NULL,
null=True, blank=True, null=True, blank=True,
related_name='processes', related_name='process_set',
help_text='Network interface used by this process' help_text='Network interface used by this process'
) )