Comments (6)
log_entry.action_date gives you the datetime of the action.
from django-audit-log.
Yeah but how do i access it using manager???
from django-audit-log.
I need to show action datetime in templates in user specific time format.
from django-audit-log.
Can you please tell me that should I use TimeStampedModel from django-extensions
along with audit-log
from django-audit-log.
You can use TimeStampedModel from django-extensions on any model if you want to. Don't confuse it with AuthStampedModel from django-audit-log.
To get the datetime of a certain action you need to get an instance of the log entry for that action. You can't get it from the manager.
In the example that you gave log_entry.action_date will give you the datetime for that log_entry, it's not a string it's a datetime.
from django-audit-log.
Thanks for your help. It was all my mistake.
self.audit_log.filter().order_by('-action_date')[0]
. I forgot .action_date
in the query self.audit_log.filter().order_by('-action_date')[0].action_date
. So sorry
from django-audit-log.
Related Issues (20)
- How can `modified_by` be manually set/updated? HOT 1
- Django 1.10 model check issue HOT 1
- Timezone Awareness for CreationDateTimeField
- obj =form.save(commit=False) does not save the AuthStampedModel Data to obj.
- Django 1.10 HOT 1
- Creating a queryset for active data
- auditlog error in django 1.11 HOT 6
- Incompatilbility with `django-modeltranslation` during tests HOT 1
- Multiple MySQL database support
- Django-rest framework 'module' object is not callable
- Django 2.0 Support HOT 12
- is not JSON serializable
- Accessing the audit data using django-admin
- Middleware raises ObjectDoesNotExist error when used in child models of django-polymorphic
- action user id field is not populating
- action_user / action_user_id always blank #6
- Concurrency hazards with audit-log? HOT 1
- Makemigrations error HOT 1
- doesn't work on Django version 3.0
- Django 3.0 compatibility issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-audit-log.