llows me to
> select one payment method from the methods that got added to the one
> specific user. (the same applies to a form field for the frontend)
>
> It would be awesome if you could help me in that point. Thank you very
> much!
>
> On Feb 24, 7:10 pm, Timothy Kinney &
by incorporating
the user id into the session id? My cookie was just called
myproject_myapp_sessionid.
-Tim
On Fri, Feb 26, 2010 at 2:07 AM, Timothy Kinney <timothyjkin...@gmail.com>wrote:
> Following: http://www.djangobook.com/en/2.0/chapter14/
>
> I used the request.session.set_test_cookie(
Also, take a look at the template Tag feature.
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-template-tags(scroll
down about half way).
It allows you to define a template (such as a dialog object) and call it
from another template, thereby inserting it where you
Django was definitely designed to be extended. But it is sometimes hard to
find the write ways to extend what you specifically want. Don't give up on
extending admin. Hopefully someone will point you in the write direction.
On Fri, Feb 26, 2010 at 11:06 AM, snfctech
Following: http://www.djangobook.com/en/2.0/chapter14/
I used the request.session.set_test_cookie() method when I pass the
login form. I then use the request.session.test_cookie_worked() method
to see if the cookie was set.
My view is setup to tell me when the test_cookie_worked() method
fails,
If it takes 60 seconds for a single item to come up on the admin site,
something is seriously wrong. You configure which items show up on the admin
site and if you configure it a certain way it may have many, many queries to
make.
If you only have one table, your query should be pretty fast.
How
** Background **
In the admin view, I want to generate a form which grabs a list of
items from the database and displays a checkbox next to each item. The
goal is simply to check multiple boxes and hit Submit and they are
deleted.
Because of the way my models are setup, there is no default admin
huilliers <
> bruno.desthuilli...@gmail.com> wrote:
>
>> On 25 fév, 20:49, Timothy Kinney <timothyjkin...@gmail.com> wrote:
>> > I think I'll just
>> > stick with urls.
>>
>> Mmmm... Fine for you if it works, but as far as I'm concerned I don't
>> like it.
/samurai_id/add_item
All I need to do is back up one.
I was always trying to put views in HttpResponseRedirect. I think I'll just
stick with urls.
-Tim
On Thu, Feb 25, 2010 at 3:51 AM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:
> On Feb 25, 1:15 am, Timothy Kinney <
I should have mentioned explicitly that these are admin views, not
standard user views. I catch the url patterns for them in myproject/
urls.py. Maybe this changes how reverse must be used?
-Tim
On Feb 24, 6:15 pm, Timothy Kinney <timothyjkin...@gmail.com> wrote:
> I have
I have two views:
samurai_detail
add_item_to_samurai
There is a button in samurai_detail that links to add_item_to_samurai.
The templates are the same except that add_item_to_samurai includes a
form to add an item.
After posting the form, I want to redirect back to samurai_detail (the
page
I have a template which extends change_form.html and I want to display
the same directory links that change_form.html displays. However, I'm
not sure which dictionary values to pass in to accomplish this. The
breadcrumbs section is:
{% trans "Home" %}
{{ app_label|capfirst|escape }}
If you are cleaning the input data (to remove the spaces) then you have this
functionality. Why do you need a further description? Sorry if I'm being
obtuse.
-Tim
On Wed, Feb 24, 2010 at 12:11 PM, jimgardener <jimgarde...@gmail.com> wrote:
>
>
> On Feb 24, 10:51 pm, Timothy Kinn
When you include the to_field, it tells Django that you want the foreignkey
to be the to_field on the CustomerProfile. It then looks for a field called
payment_id (following the foreignKey relationship). This is normal.
If you remove the to_field, it will choose the primary key of
CustomerProfile
I believe you want to use the {% *trans* %} template method.
http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/
-Tim
On Wed, Feb 24, 2010 at 7:18 AM, Tor Nordam wrote:
> I'm currently developing a project for making course webpages at my
>
rde...@gmail.com> wrote:
>
>
> On Feb 24, 9:55 pm, Timothy Kinney <timothyjkin...@gmail.com> wrote:
> >Just add
> > the option *unique=True* when you define the field in the model and the
> > database will not allow two entries with the same value for that fie
I agree with Pablo. Don't start designing queries until you've designed your
database relations, because the queries are meaningless if you change
relationships.
Sit down with a piece of paper and list or draw bubbles or whatever so that
you can establish what your models are, what the fields are
I'm not an expert on this, but will give it a stab.
If you use a template system then the deeper web pages for a particular site
will be extending the index pages. I think you could set up your different
site names to all inherit from a single media_player.html template that has
the flash player
As far as requiring a unique value you can set this in your model. Just add
the option *unique=True* when you define the field in the model and the
database will not allow two entries with the same value for that field. On
the other hand, if you have something like first names and last names you
to optimize my query
even more and also get a better understanding of database query theory.
Thank you all!
-Tim
On Wed, Feb 24, 2010 at 9:40 AM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:
> On Feb 24, 9:08 am, Timothy Kinney <timothyjkin...@gmail.com> wrote:
&g
I have models which describe a game. There are 61 provinces with 9
rooms in each province, for a total of 549 locations. There are
several hundred samurai, each assigned to a particular room id.
Province(name, id, exits)
Room(id, name, foreignkey('Province'))
Samurai(id, name, foreignkey('Room'))
x.prefix == i.dst[:l]:
> > rated = x.rate
> >
> > if type(y) == float and y > int(y):
> > zz = (int(y)+1) * rated
> > else:
> > zz = rated * y
> >
t;
> here you can see i am using call.minz , while minz is a function in
> models.py under class Ast . in this function it works fine if i put a
> static rate for all records against self.billsec but i want it to
> match with other table from Database . And am not getting if i try to
> c
I would like to include the following values on my admin pages, as
part of the base_site:
time_to_query_database
time_to_render_page
Is there code I can draw from to accomplish this? Or do I need to code
it myself?
Are there built-in methods in Django for timing database queries to
help users
p://173.45.115.106/template.jpg
>
> This will probably clear me , that what i want in my column "call
> Cost" in my datatable.
> thanks
>
>
>
> On Feb 24, 2:47 am, Timothy Kinney <timothyjkin...@gmail.com> wrote:
> > It sounds like you should have
It sounds like you should have a look at:
http://docs.djangoproject.com/en/dev/ref/templates/
Instead of rendering straight to html you can structure the html as a
template and then feed your dictionary context in. Then your view points to
the template. If your template was called test.html then
I agree, your models are correct. You just need to create a view (possibly
using a template) to serve this information to the web.
-Tim
On Tue, Feb 23, 2010 at 4:16 PM, Daniel Roseman wrote:
> On Feb 23, 9:10 pm, soFh wrote:
> > Well i was already
argument for just writing the json file,
actually. If anyone has comments on how best to create a large number of
objects at runtime (say 100 to 500), I'd be happy to hear them.
Hopefully, this helps someone else.
-Tim
On Mon, Feb 22, 2010 at 12:18 PM, Timothy Kinney
<timothyjkin...@gmail.com>
Sorry, I'm having trouble understanding exactly what you want. Could you be
more specific about your models and your calculations?
Let me take a stab at a guess, though. Let's say you have a model City with
a population field and a model WaterUse with a total_water_use field. Then
let's say you
Sorry, I just thought of something else. You could add a field to the
database that contains the calculated quotient and then order by that
column.
-Tim
On Tue, Feb 23, 2010 at 1:50 PM, Timothy Kinney <timothyjkin...@gmail.com>wrote:
> I think I would write a custom funct
I think I would write a custom function to do this, but there may be a good
reason to have the ORM do it for you (I'm not a database guy).
If it was my app, I would probably just do this:
**
def order_by_quotient(a,b):
q = []
for i in range(len(a)):
q.append(a[i]/b[i])
return
Katana', u'Wakizashi']
How can I construct the query set to just print the list (without the [ ]
brackets) and without the unicode u in front of everything? Like this:
O-yoroi, Rice, Sharp Katana, Wakizashi
Thank you for your time.
-Tim
On Fri, Feb 19, 2010 at 3:48 PM, Timothy Kinney
the samurai in the correct province.
I think I can extract this information from the request though. We shall
see.
-Tim
On Mon, Feb 22, 2010 at 12:08 AM, Timothy Kinney
<timothyjkin...@gmail.com>wrote:
> Okay, I've got such a button and I have copied a template from admin to
> serv
If a user disallows cookies on their own machine, there's nothing you can do
about it. This is why a lot of websites say: "You need to have cookies
enabled."
On Mon, Feb 22, 2010 at 10:27 AM, adamjamesdrew wrote:
> This is not an issue with me as I can just turn off the
rom within the instance of the province I want to update? If so, how do I
tell the pattern matching to ignore that?
-Tim
On Fri, Feb 19, 2010 at 5:21 PM, Peter Herndon <tphern...@gmail.com> wrote:
>
> On Feb 19, 2010, at 5:51 PM, Timothy Kinney wrote:
>
> > So I have a nice little
You basically just need to copy the admin templates and views (see the
django.contrib.admin directory) to your user templates and views (you can
set where this directory is in settings.py, but it's often a directory
called templates under your project or your app). Then it should be easy to
look
Maybe the problem is that you don't quite understand what models are for. If
you just want to create a report from your SQL data you use the models to
structure the data and define relationships, not to report it. You use the
views and the templates to generate the actual report.
Does that make
There may be a more elegant way, but I think you could just call the login
view from whatever view the url directs the user too. So it fills in the
login info and then renders the rest of the page...but on second thought
maybe you need to include the login form in every view...
On Sun, Feb 21,
+1
On Sat, Feb 20, 2010 at 9:38 PM, Shawn Milochik wrote:
> I used the same comparison you did, and I ended up going with Django-CMS. I
> like it a lot.
>
> As for importing the content, that should be pretty easy. Once you see how
> Django-CMS works you'll just need to make
This is strange. When I duplicate your code, thanos, I get an error that
says:
AttributeError: SubClass instance has no attribute '__bases__'
What's different about my setup?
I'm running Python 2.5.3
-Tim
On Fri, Feb 19, 2010 at 6:43 PM, thanos wrote:
> How about:
>
> >>>
You could also go with a column called "Execute" and a checkbox for the
actions you want to execute and then a single submit button that grabs all
the checked actions. But I think the other way is probably more intuitive.
-Tim
On Sat, Feb 20, 2010 at 10:45 AM, Tom wrote:
>
This is an old document, but is useful for understanding class structure in
python:
http://www.python.org/download/releases/2.2/descrintro/
I think you might want the subclass.__class__ method.
On Fri, Feb 19, 2010 at 4:51 PM, Joel Stransky wrote:
> Bit of a python
So I have a nice little database now stocked with items and provinces.
I now want to generate random samurai and populate the database with
them. I can think of two ways to do this:
1) Through the admin interface. But how do I install a button that
will add a random samurai? Adding samurai is a
log.rk.edu.pl/w/p/code-snapshot-ice-isle-django-web-crpg-game/
> http://github.com/batiste/django-rpg
>
> sounds like it could be a great project. have fun!
>
> On Feb 19, 2:18 pm, Timothy Kinney <timothyjkin...@gmail.com> wrote:
> > Hi Tim,
> >
> > Thanks f
string)
pk_count = 1
for key in provlist:
string = getFieldsString(key)
f.write(string)
f.close()
*** / code ***
Then I need to strip the last comma from the file and add the closing
bracket. There is probably a more elegant way to do this, but this is what
came to mind first. I open t
t; translate it to a Django model:
>
> class Inventory(models.Model):
>samurai = models.ForeignKey('Samurai')
>item = models.ForeignKey(Item)
> condition = models.IntegerField(default=100, blank=True,
> verbose_name='condition')
>
> Hope this helps.
>
> On F
the
name up for a template. Since every province has a unique ID, I don't think
there will ever be a stack-overflow.
I appreciate the input.
-Tim
On Fri, Feb 19, 2010 at 9:07 AM, Javier Guerra <jav...@guerrag.com> wrote:
> On Fri, Feb 19, 2010 at 2:48 AM, Timothy Kinney
> <timothyjk
I started playing with this last night and got about as far as you mentioned
here. What I want to be able to do, though, is write a python script that
writes an authentic json flatpage that I can import into the database. I
have a large textfile full of names, items, and province information (for
alue.
-Tim
On Fri, Feb 19, 2010 at 2:32 AM, Le Quoc Viet <viet.aikid...@gmail.com>wrote:
> Hi Tim,
>
> Thanks for reply. I mean if I want Samurai to be out of all rooms?
> ForeignKey disallows Null. Should I do like this: Create a default dummy
> Room and assign it by defa
onal databases. Perhaps an article on basic database design
> might help. It's best to really understand how a relational database
> works and should be designed before trying to work with Django's ORM.
>
>
> http://www.deeptraining.com/litwin/dbdesign/FundamentalsOfRelationalDatabas
r Herndon wrote:
>
> On Feb 18, 2010, at 11:47 PM, Timothy Kinney wrote:
>
>
>
> Here's the system I'm currently using that doesn't work too well...
>
> Samurai (id, name)
>
> Room (id, name, ForeignKey(Samurai), ForeignKey(Province))
>
> Province (id, name)
&
What does it mean to check about index selectivity? Sorry, my knowledge of
databases is mostly as a user. But I am learning a lot this week.
-Tim
On Fri, Feb 19, 2010 at 1:39 AM, Javier Guerra <jav...@guerrag.com> wrote:
> On Fri, Feb 19, 2010 at 2:31 AM, Timothy Kinney
>
fer a list if possible.
Cheers.
-Tim
On Thu, Feb 18, 2010 at 11:38 PM, Peter Herndon <tphern...@gmail.com> wrote:
>
> On Feb 18, 2010, at 11:47 PM, Timothy Kinney wrote:
>
> >
> > Here's the system I'm currently using that doesn't work too well...
> >
> > Samu
I'm having some trouble wrapping my head around some ORM concepts in
Django.
I have a Samurai model, and I want to develop a Province and Room
model. The idea is that each Room is associated with a Province (is in
the province) and each Room can hold multiple samurai (and items).
I want to be
lp. It's best to really understand how a relational database
> works and should be designed before trying to work with Django's ORM.
>
>
> http://www.deeptraining.com/litwin/dbdesign/FundamentalsOfRelationalDatabaseDesign.aspx
>
> On Feb 18, 3:17 pm, Timothy Kinney <timo
Hello, I'm new to Django, but learning as fast as I can. I would
appreciate some technical help and some database design advice...
**
1) Admin pluralizing question
So I have three models: samurai, item, inventory
When I login to the admin screen it has chosen to pluralize them as:
samurais,
Check out the http shortcuts:
http://docs.djangoproject.com/en/dev/topics/http/shortcuts/
There is one for redirect that can redirect you to a function in the view.
-Tim
On Thu, Feb 18, 2010 at 1:49 PM, Ryan Mark wrote:
> Any thoughts as to how I could get the view function from
This happened to me before. I solved it by first writing generic text in the
template and then making sure that the text would show. Then I passed a
variable to the template but left it defined as {None: None} to see if I was
making the call correctly. Finally, I edited the variable to be some
Sorry for the noob question, but what is a Buildout recipe?
On Thu, Feb 18, 2010 at 11:30 AM, Gustavo Narea <
gustavona...@2degreesnetwork.com> wrote:
> Hello,
>
> I'm pleased to announce Djangout, a set of Buildout recipes for
> Django. Although that "set" is made of just one item, we find this
Can you successfully log in to the admin site using the test server?
On Thu, Feb 18, 2010 at 10:18 AM, hooda_28 wrote:
> hi im having a problem for about an hour now, i have a model
>
> class Dummy(models.Model):
>sell = models.CharField(max_length=20,
, 2010 at 4:33 PM, Timothy Kinney <timothyjkin...@gmail.com>wrote:
> I am using a basic authentication/login scheme in Django 1.1.1 and
> Python 2.5.3. It behaves correctly if I login correctly, or if I use
> use a correct username but wrong password. It also works for an
> unknow
Is it possible to transfer the valid session from Django to RoR? I'm not
really sure if that makes sense, but it's what comes to mind. Basically, if
you have already authenticated on one framework you should be able to pass
along the authentication without having to copy the password over.
FWIW
I am using a basic authentication/login scheme in Django 1.1.1 and
Python 2.5.3. It behaves correctly if I login correctly, or if I use
use a correct username but wrong password. It also works for an
unknown username AND any password. However, if I type in a username
that is not in the database
Django seems to be an ideal platform for creating browser games, ie
lightweight MMORPGs. Searching the archives I found some references to
others doing this in 2007 and 2008. Is anybody aware of any current
projects (especially open source) that use Django to publish browser
game content?
Also,
64 matches
Mail list logo