We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I'm instructing queryset to be converted to Pandas dataframe with
to_dataframe(['id', 'employee', 'employee_id'],index='job_date')
In df's column employee_id I have the same value as employee.
In [97]: df = Job.objects.all().order_by('-id')[:100].to_dataframe(['id', 'employee', 'employee_id'],index='job_date') In [98]: df Out[98]: id employee employee_id job_date 2017-07-18 918187 [email protected] [email protected] 2017-07-18 918186 [email protected] [email protected] 2017-07-18 918185 [email protected] [email protected] 2017-07-18 918184 [email protected] [email protected] In [100]: Job.objects.last().employee Out[100]: <Employee: [email protected]> In [101]: Job.objects.last().employee_id Out[101]: 115
I have a str method in Job class
class Job(SyncTimeStampedModel, BaseModel): employee = models.ForeignKey( to='users.Employee', on_delete=models.PROTECT, related_name='jobs', verbose_name=_('Employee'), ) class Employee(TimeStampedModel, BaseModel): def __str__(self): return self.user.username
So how to export the ID into dataframe?
The text was updated successfully, but these errors were encountered:
I have the same problem. The workaround I'm using is employee__id instead of employee_id
employee__id
employee_id
Sorry, something went wrong.
No branches or pull requests
When I'm instructing queryset to be converted to Pandas dataframe with
to_dataframe(['id', 'employee', 'employee_id'],index='job_date')
In df's column employee_id I have the same value as employee.
I have a str method in Job class
Question
So how to export the ID into dataframe?
The text was updated successfully, but these errors were encountered: