Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporter tool and minor changes to importer tool #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hitengajjar
Copy link
Contributor

@hitengajjar hitengajjar commented Feb 13, 2020

Please review and accept if all well. Below changes -

Exporter tool

  1. Exporter tool creates excel workbook where it exports all the models in dedicated worksheet.
  2. Component Version table is exported 2 sheets. (a) latest and (b) all without latest. To find out which is latest version introduced ComponentVersionList model.
  3. Component Version sheets also includes fields from component table
  4. Multiple entries in a cell are represented as -
    `* entry1
  • entry2`
  1. Cross reference (Excel data validation list) is enabled where-ever its applicable.
  2. Added Excel comments to columns where cross-referenced data exists with multiple entries (excel data validation doesn't allow to add multiple values in a cell)
  3. Execute the tool on command line as
    python3.6 ./manage.py exporter -o -x export_file.xlsx
    Options are:
    x - output excel file name
    o - overwrite excel file if exists

Importer tool

  1. Cosmetic changes related to logging
  2. Take into account new model ComponentVersionList

* Component version list needs to be separately maintained and hence models are modified
* Importer tool was changed as a result of component version list
@@ -238,6 +238,12 @@ def __str__(self):
return "%s" % self.name



Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check django admin component version creation page?

@@ -238,6 +238,12 @@ def __str__(self):
return "%s" % self.name



class ComponentVersionListModel(models.Model):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose Version name. Also without Model part

@@ -301,8 +307,10 @@ def __str__(self):
class ComponentVersionModel(models.Model):
component = models.ForeignKey(ComponentModel, on_delete=models.PROTECT, related_name='component_version')

version = models.CharField(max_length=64, verbose_name="Version or build",
help_text="note: component version instance will be cloned if you change version!")
version = models.ForeignKey(ComponentVersionListModel, to_field='version',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to leave models.CharFiled and move release_date field to ComponentVersion. My opinion ComponentVersionList equal to ComponentVersion. Also we should review meta_updated field: may be it equal to release_time. @perfguru87 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants