Re: Newbie question - data structure for game

2016-10-29 Thread Yaşar Arabacı
I am also quite new to django, but I will go with something like this; class Quote(models.Model): quote= models.CharField(max_length=100) class EncryptedQuote(models.Model) quote = models.ForeignKey(Quote, on_delete=models.CASCADE) encrypted_quote = models.CharField(max_length=100)

Migrating custom mysql application to django orm

2016-10-29 Thread Yaşar Arabacı
Hi, I am trying to migrate my mysql application into django orm. I need help converting my sql statements into it. Here are my models class SearchableText(models.Model): searchable_text = models.TextField() class SearchTerm(models.Model): searchabletext = models.ForeignKey(SearchableText

Re: Django tutorial, cannot add "polls" to admin

2011-10-06 Thread Yaşar Arabacı
How does your urls.py look like? Did you uncomment admin related things in there? 2011/10/6 Ser5 > Hi! Help me please to solve one tutorial problem. > > Now I'm reading the 2nd part of the tutorial and have stuck with adding > polls app to the Django admin. > Everything worked fine in the tutori

Re: How to make Django pick new urls immediately

2011-10-06 Thread Yaşar Arabacı
maybe you should restart the server? And, do you include new urls in your root url config? 2011/10/6 Kayode Odeyemi > Hello, > > I don't know if I'm the only one experiencing this. I have multiple urls.py > in different packages based on > the similarities of the modules. Everytime I add a new u

Re: Beginner a bit lost - need some pointers please

2011-10-05 Thread Yaşar Arabacı
This documentation goes over deployment of django: https://docs.djangoproject.com/en/1.3/howto/deployment/ 2011/10/5 Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> > Hi Chris, > > I'm assuming that you don't have any experience with Python?? > > Also - have you read th

Re: best way to get started with Dajngo?

2011-10-01 Thread Yaşar Arabacı
If you didn't checked this already: https://docs.djangoproject.com/en/1.3/intro/tutorial01/ 2011/10/1 ruchita rathi > Hi, > > Can someone point to the documents/videos for getting started with Django? > > Best, > Ruchita > > -- > You received this message because you are subscribed to the Google

Re: CSRF with AJAX problem

2011-09-30 Thread Yaşar Arabacı
To create csrf cookie without using csrf tag, your view needs to be decorated with django.views.decorators.csrf.ensure_csrf_cookie. Also check: https://code.djangoproject.com/ticket/16936 2011/9/30 Kenneth Love > You're using AJAX and forms incorrectly, then. Any form that has a > solid effect o

Re: sending and receiving data using ajax/html

2011-09-15 Thread Yaşar Arabacı
ions would be good > > 2011/9/15 Yaşar Arabacı > >> Why do you want to use ajax, instead of regular form post to next page. >> When in next page, you can create hidden form fields to store data you >> passed from first page, and then you can post them again i

Re: sending and receiving data using ajax/html

2011-09-15 Thread Yaşar Arabacı
Why do you want to use ajax, instead of regular form post to next page. When in next page, you can create hidden form fields to store data you passed from first page, and then you can post them again in any page you want. 2011/9/15 jay K. > > Hello > > I have a page where a user makes a selectio

Re: Pagination of more than one field

2011-09-06 Thread Yaşar Arabacı
I think your question can be solved with javascript and ajax, rather than with django. How is your knowledge in that area? 2011/9/6 OC > Hi, > > I am new to django and I have a pagination question: > In my web page I need to display 2 query results of two different > tables > Each result is disp

Re: How to group models month by month.

2011-09-06 Thread Yaşar Arabacı
_month=month.month).count() Then in template: {% for year, month_dict in date_hierarchy.items %} {% for month,post_count in month_dict.items %} {{ month|date:"Y E" }} [{{ post_count }}] {% endfor %} {% endfor %} 2011/9/6 Andre Terra > http://django.me/aggregation > > > C

How to group models month by month.

2011-09-06 Thread Yaşar Arabacı
I have a model with datetime field. I want to get a table with three columns as, year, month and number of items in time span. And I also want to order them from newest to oldest. What I want to get is something like this: 2011 August 4 2011 March 7 How do you suggest I should do that? I am tryi

Minimal change broken my csrf validation.

2011-09-05 Thread Yaşar Arabacı
Can you please take a look at here: http://stackoverflow.com/q/7312029/886669 -- http://yasar.serveblog.net/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe fro

Can I write tests for 3rd party url shortener?

2011-09-02 Thread Yaşar Arabacı
Hi, Is there a way to test whether or not a 3rd party url shortener works. What I have in mind is this: get short url from third party application send a request to that link see if that link is redirected to what it is supposed to redirected? -- http://yasar.serveblog.net/ -- You received th

Value Checking in Custom save method of admin site

2011-08-26 Thread Yaşar Arabacı
Hi, I have implemented a custom save method for one of my models like this: def save_model(self,request,obj,form,change): if obj.slug == "" or obj.slug is None: obj.slug = slugify(obj.title) # I get database representation of the object to check if # it was not

Re: Drag and drop functionality?

2011-08-26 Thread Yaşar Arabacı
It is my understanding that, drag and drop functionality depends on browser capabilities. You may want to see these two links: https://developer.mozilla.org/en/drag_and_drop_javascript_wrapper https://developer.mozilla.org/en-US/demos/detail/motivational-poster 2011/8/26 francescortiz > By your

Re: Help with Django code.

2011-08-26 Thread Yaşar Arabacı
Try this, always worked for me, import os import sys # assuming this file resides at the same directory at settings file PROJECT_FOLDER = os.path.abspath(os.path.dirname(__file__)) UPPER_PATH = os.path.abspath(PROJECT_FOLDER + "/../") sys.path.append(UPPER_PATH) os.environ['DJANGO_SETTINGS_MODUL

Re: Need Ideas On Data Migration

2011-08-24 Thread Yaşar Arabacı
tricky when first starting to use it but it is a powerful system. >> >> Otherwise you could alter the table yourself and copy the data using SQL >> or the django-admin shell. >> >> [1] http://south.aeracode.org/ >> >> -- >> Rory Hart >> http://ww

Need Ideas On Data Migration

2011-08-24 Thread Yaşar Arabacı
Hi, I have a model with a char field. All data saved in database in that field is a valid slug. Now I want to add this model a slug field, and copy all data from char fields to slug fields like so: Table before change: text = thisisavalidslug(char field) Table after change: text=thisisavalidsl

Re: can django be used in destop application?

2011-08-23 Thread Yaşar Arabacı
I had written something about this earlier, Although the article is in Turkish, you can still understand the django part I guess. It demonstrates how to use django component with other applications, by creating a dummy package manager. http://yasar.serveblog.net/post/djangoda-paket-yoneticisi-yapal

Re: Django Development environment

2011-08-23 Thread Yaşar Arabacı
Development setup (when on my own comp.): arch linux, vim or leafpad, sqlite, django development server Development setup (when on my brothers comp): cygwin, notepad++, sqlite, django development server (both inside and outside of cygwin to make sure everything is same.) Deployment: ubuntu (cloud

Re: Debud setting behaves weird

2011-08-23 Thread Yaşar Arabacı
This makes sense :) Warning This view will only work if DEBUG is True. That's because this view is *grossly inefficient* and probably *insecure*. This is only intended for local development, and should *never be used in pro

Re: Debud setting behaves weird

2011-08-23 Thread Yaşar Arabacı
o dev server running, and see that file served. make DEBUG=False in settings refresh page see my 500 template I can repeat this as much as I want. 2011/8/23 Kejun He > Hi > Which platform did your project run? > On the development platform or the publishing platform ? > > 2011/8/23 Ya

Debud setting behaves weird

2011-08-23 Thread Yaşar Arabacı
Hi, When I set debug=True in my settings module, my static files work. When I set it to False, I get 404 on my static files. Anyone has an ide what is going on here? -- http://yasar.serveblog.net/ -- You received this message because you are subscribed to the Google Groups "Django users" grou

2 url template tag questions

2011-08-22 Thread Yaşar Arabacı
Hi, If a use url template tag on a generic view, does urls.py supply required arguments? For example: urlpatterns = patterns('django.views.generic.date_based', (r'^arsiv/(?P\d{4})/$','archive_year',{ 'template_name' : 'blog/yillar.html', 'date_field' : 'pub_date',

Re: dynamic form with popup

2011-08-22 Thread Yaşar Arabacı
If you want to dynamically update your Cart without refreshing the page, yes you will need to write some heavy ajax. But if you are okey with page refreshing, you can temprorarily save your cart in session and use formsets as shawn suggested. 2011/8/23 ozgur yilmaz > thanks, > > but i think i ha

Re: dynamic form with popup

2011-08-22 Thread Yaşar Arabacı
see checked out Carts on the admin panel. 23 Ağustos 2011 00:12 tarihinde Yaşar Arabacı yazdı: > I don't know the answer, but you may want to check this out: > http://www.satchmoproject.com/ > > > 2011/8/23 ozgur yilmaz > >> Hi, I have a problem. >> >>

Re: dynamic form with popup

2011-08-22 Thread Yaşar Arabacı
I don't know the answer, but you may want to check this out: http://www.satchmoproject.com/ 2011/8/23 ozgur yilmaz > Hi, I have a problem. > > I have two models: > > class CheckOut(models.Model): > models.DateField() > > class Product(models.Model): > checkout = models.ForeignKey( CheckOut )

Re: Admin Stopped Saving Record Changes!

2011-08-21 Thread Yaşar Arabacı
Well, that is because no error occured :) 2011/8/21 Lee > Solved: in the process of fixing indentation errors I accidentally > indented "obj.save()" so that it only fired on inserts not updates. > Interesting that Admin still generated the "Successful" message when > no save occurred. > > -- > Y

Re: Port of Django Template Language to PHP

2011-08-21 Thread Yaşar Arabacı
I am considering writing about it, but I want to test it first. Since I am not on my own computer, that will need to wait a little :) 2011/8/21 Rune Kaagaard > @Yaşar: Thanks a lot, would love to see the post if you really do write it! > > @Kenneth+@Masklinn: You are right, there are a lot of te

Re: Port of Django Template Language to PHP

2011-08-20 Thread Yaşar Arabacı
Wow, this is definitely going into my blog :) Keep up the good work! 2011/8/20 Rune Kaagaard > Dear Django Users > > Those of you moonlighting in PHP, might be interested in a pure PHP > port of the Django Template Language that I've just released. It's > called Chano and has doc pages at http:/

Suspicious mail from django-users mail group

2011-08-20 Thread Yaşar Arabacı
Hi, I got a mail, which I suspect that might be some kind of personal information stealing thingy. It askes me enable images or click some links. Does anyone else got similiar mails? I am attaching original mail. I tried to locate the sender, but, couldn't find the exact location. -- You receive

Re: Missing datepicker in Django 1.3 admin

2011-08-20 Thread Yaşar Arabacı
fault. It does't show even with a new Project! > > On Aug 20, 9:39 pm, Yaşar Arabacı wrote: > > If that is what kenneth says, I might suggest creating a new project and > see > > default settings for static files. it might help you figure out

Re: Missing datepicker in Django 1.3 admin

2011-08-20 Thread Yaşar Arabacı
If that is what kenneth says, I might suggest creating a new project and see default settings for static files. it might help you figure out what is going on. 2011/8/20 George > Thanks Kenneth > > I commented that out .. I'm still not seeing the datepicker icons in > admin! > > On Aug 20, 2:51 p

Re: View-Voodoo: Calling functions in a view does weird things

2011-08-20 Thread Yaşar Arabacı
Do it like this: def myview(request): if request.method =="POST": return call_my_other_func(request) else: rtr("index.html") def call_my_other_func(request): # do something with the data messages.info(request, "hello world") return rtr("index.html", context_instance=RequestC

Re: Strange behavior in model.save()

2011-08-19 Thread Yaşar Arabacı
I don't quite understand what you did there, but, it seems to me it is the same thing with your initial post. ref = getattr(self, f.name) -> you are getting a field here, this field is a empty descriptor, doesn't hold any data yet. ref.full_save(*args,*kwargs) -> you populated your field with data

Re: Initialization code that should only run under a web server

2011-08-19 Thread Yaşar Arabacı
I didn't try this but might work. You can create a second manage.py called for example manage2.py file with following contents: #!/usr/bin/env python from django.core.management import execute_manager import imp try: imp.find_module('alternative_settings') # Assumed to be in the same directory.

Re: Strange behavior in model.save()

2011-08-19 Thread Yaşar Arabacı
And your second function works because when you set meeting.place = meeting.place, unsaved place object gets changed with saved place object :) Nice catch though. 19 Ağustos 2011 15:28 tarihinde Yaşar Arabacı yazdı: > It is because you are creating meeting object, before saving "plac

Re: Strange behavior in model.save()

2011-08-19 Thread Yaşar Arabacı
It is because you are creating meeting object, before saving "place" in db. So place object doesn't have any id yet. So test 1 should be: place = Place(where='Paris') place.save() meeting = Meeting(place=place, when='2011-01-01') meeting.save() return meeting 2011/8/19 Jacco >

Re: Getting and modifying url parameters in template: howto?

2011-08-19 Thread Yaşar Arabacı
You can either send required information from your view to your template, or do some javascript on the browser side. 2011/8/19 samuele.mattiuzzo > Yeah, i was thinking about that... > > A template tag like {% my_url %} > > could be something like that... > > On Aug 18, 6:36 pm, Andre Terra wr

M2M with self throught int. table, how to access related items?

2011-08-16 Thread Yaşar Arabacı
Hi, I have tried to sent this e-mail before, but I guess it didn't make its way to the groups so I am trying to resent it, if this is a double post, I am sorry. I am having trouble understanding m2m relation to self with a intermediary table. Here is my table setup stripped: class Post(models.

Re: model save question

2011-08-16 Thread Yaşar Arabacı
Absence of **kwargs would cause problems if for example save method is called with "using" keyword argument. You could either list all the available keyword arguments or use **kwargs. By the way, is there any other kwarg for save? 2011/8/16 Mike Dewhirst > When using save() in a model, what is

M2M with self throught int. table, how to access related items?

2011-08-16 Thread Yaşar Arabacı
Hi, I am not a django guru (yet) and I am having what I would guess a trivial django question. Here is my table setup stripped: class Post(models.Model): relevancy = models.ManyToManyField("self",through="Traffic",symmetrical=False,related_name="relevant",blank=True) class Traff