I'm new to Drupal.
I added articles using the user 1 account and using another authenticated user. When I click on the author name, it shows me the status of the user.
How do I show all articles from the same author?
you can create a drupal view
/admin/structure/views/add
display all fields you like from the article and filter with author
You can even exposed the filter
Related
I'm really struggled by this. I looked through the Django documentation and I couldn't find a method to get the site_id of the currently logged in user_id with Sites framework.
I want to build a blogpost form and I wan't to include the site_id so that the content that the user publish will go to that particular site_id.
The user will only have permissions to publish to one site_id.
To clarify:
Publish content to the site_id that the user_id belongs to.
Is there a way to do this?
A user does not belong to a site. A request does.
If, somehow, in your Django project sites are owned by users, then you should add a new field to your User model. Something like this:
class MyUserModel(...):
...
blog = models.OneToOneField(Site)
I have an django site for new articles , in which multiple user write articles.
I want to make an action for selecting a user , so that If I choose a particular user , I can only see its updation/insertion in admin site.
If updation/insertion is part of a model that has an foreign key to USER model, then just write an admin-inlline to show a list of them in the user page below all other fields
I have a model for a blog post where the owner of the post is a foreign key to User. With that model any user can own a blog post. I would like to change it so that only the users in a certain group -let's call it 'bloggers'- can own a blog post object. Ideally it should appear in the admin too, I mean in the blog post admin right now the menu for 'owner' lists all the users, it should only list the ones in the 'bloggers' group.
How do I do that with Django 1.3?
Use limit_choices_to paramether in your ForeignKey definition like this:
author = models.ForeignKey("auth.User", limit_choices_to={'groups__name': "bloggers"})
I am using Facebook Open Graph with an approved action called "order". When our users make a purchase on the site, we will post what they bought in timeline and news feed. I chose the gallery view in aggregation. It shows up correctly in timeline, but not in news feed. In the newsfeed, the products are in a list view. My guess is that I'm passing the urls of the product page back to facebook, so it shows as a list of items, not just the pictures. What's the right way to make the products show up in news feed as a gallery, like pinterest or instagram?
Here's my code to post the products
purchase.products.each do |product|
graph_api.put_connections("me", "#{namespace}:order?product=#{product_url(product)}")
end
Thanks
My Book model has an author attribute which today is simply a CharField. The value for author should be one of the registered users of my Django site. When creating a new Book object in Django admin, I would like author to be displayed as a combo box showing all registered users. How would I go about achieving this?
You can make your author attribute a foreign key to django.contrib.auth.models.User and use limit_choices_to.