diff options
author | Dan McGee <dan@archlinux.org> | 2012-12-31 17:17:22 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-12-31 17:17:22 +0100 |
commit | 04f23a040a839f4989fdc83afe0f5ad4f72224be (patch) | |
tree | 4118ce2a278f895bfb54d9f35ba2a3897d4cd3a6 /devel | |
parent | 5a09e335ae3b9d1f2bc814d011bcf90a16220777 (diff) | |
download | archweb-04f23a040a839f4989fdc83afe0f5ad4f72224be.tar.gz archweb-04f23a040a839f4989fdc83afe0f5ad4f72224be.tar.xz |
Add 'created' field to packages model
This will be used to eventually implement the UI side of FS#13441, but
to do that, we first need the data.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r-- | devel/management/commands/reporead.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 981c4dc..e00e54c 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -387,10 +387,12 @@ def db_update(archname, reponame, pkgs, force=False): # packages in syncdb and not in database (add to database) for pkg in (pkg for pkg in pkgs if pkg.name in in_sync_not_db): logger.info("Adding package %s", pkg.name) - dbpkg = Package(pkgname=pkg.name, arch=architecture, repo=repository) + timestamp = now() + dbpkg = Package(pkgname=pkg.name, arch=architecture, repo=repository, + created=timestamp) try: with transaction.commit_on_success(): - populate_pkg(dbpkg, pkg, timestamp=now()) + populate_pkg(dbpkg, pkg, timestamp=timestamp) Update.objects.log_update(None, dbpkg) except IntegrityError: if architecture.agnostic: |