This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code in Blog model | |
########################## | |
feed.entries.each do |entry| | |
puts "=== creating new post..." | |
post = Post.new(:title => entry.title) | |
post.blog_id = self.id | |
puts "=== blog_id = #{post.blog_id}" | |
# code never reaches past Post.new line | |
# I have a datetime field (post_date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% content_for(:calendar) do %> | |
<%= render 'calendar' %> | |
<% end %> | |
------------ | |
<% content_for(:calendar) { render :partial => 'calendar' } %> | |
------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Item(models.Model): | |
category = models.ForeignKey(Category, related_name='items') | |
city = models.ForeignKey(City, verbose_name=u'المنطقة', related_name='items') | |
activation_code = models.CharField(max_length=64) | |
is_active = models.BooleanField(default=False) | |
is_deleted = models.BooleanField(default=False) | |
email = models.EmailField(u'البريد الإلكتروني') | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now=True) | |
title = models.CharField(u'العنوان', max_length=200) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FacebookMiddleware(): | |
def process_request(self, request): | |
api_key = settings.FACEBOOK_API_KEY | |
secret_key = settings.FACEBOOK_SECRET_KEY | |
request.facebook = Facebook(api_key=api_key, secret_key=secret_key, request=request) | |
if request.facebook.is_logged_in(): | |
username = request.facebook.get_uid() | |
try: | |
curr_user = User.objects.get(username=username) | |
try: |
NewerOlder