mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
docs
This commit is contained in:
@@ -115,7 +115,7 @@ You can populate your data from peeringdb.com using
|
|||||||
|
|
||||||
However be prepared for this to take 15-20 minutes as it will not only sync the entities, but also set up usergroups for each organization and so forth.
|
However be prepared for this to take 15-20 minutes as it will not only sync the entities, but also set up usergroups for each organization and so forth.
|
||||||
|
|
||||||
This can only be used to populate initial data. Once you have started adding / updating objects and your data diverges from production data, it is no longer useful to call this command nor will it allow you to.
|
This should only be used to populate initial data. Once you have started adding / updating objects and your data diverges from production data, it is no longer useful to call this command.
|
||||||
|
|
||||||
Special Note: this will only sync data visible to everyone, any fields or rows hidden behind authentication will be missed.
|
Special Note: this will only sync data visible to everyone, any fields or rows hidden behind authentication will be missed.
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,11 @@ def sync_obj(cls, row):
|
|||||||
print(obj, obj.id)
|
print(obj, obj.id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# we want to validate because it fixes some values
|
||||||
|
# but at the same time we don't care about any validation
|
||||||
|
# errors, since we can assume that the data from the
|
||||||
|
# server is already valid, nor do we want to block import
|
||||||
|
# because our validators differ from the servers.
|
||||||
obj.full_clean()
|
obj.full_clean()
|
||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
pass
|
pass
|
||||||
@@ -100,11 +105,4 @@ class Command(BaseCommand):
|
|||||||
pdb_models.NetworkIXLan
|
pdb_models.NetworkIXLan
|
||||||
]
|
]
|
||||||
|
|
||||||
for model in djpdb_models.all_models:
|
|
||||||
count = model.objects.all().count()
|
|
||||||
if count > 0:
|
|
||||||
self.stdout.write("This command should only be called on an empty database")
|
|
||||||
self.stdout.write("We already found {} {} in the database, aborting.".format(count, model))
|
|
||||||
return
|
|
||||||
|
|
||||||
call_command("pdb_sync")
|
call_command("pdb_sync")
|
||||||
|
|||||||
Reference in New Issue
Block a user