diff options
author | Dan McGee <dan@archlinux.org> | 2012-12-31 10:17:22 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-12-31 10:17:22 -0600 |
commit | 04f23a040a839f4989fdc83afe0f5ad4f72224be (patch) | |
tree | 4118ce2a278f895bfb54d9f35ba2a3897d4cd3a6 /devel/management | |
parent | 5a09e335ae3b9d1f2bc814d011bcf90a16220777 (diff) |
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/management')
-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 981c4dce..e00e54c3 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: |