|
MonkeyMaker posted:Anyone here going to DjangoCon? I'm going to try to make it to the next djangocon europe.
|
# ? Sep 5, 2011 19:30 |
|
|
# ? May 16, 2024 21:18 |
|
http://djangocon.us/livestream/ There goes my productivity for the week.
|
# ? Sep 6, 2011 16:09 |
|
MonkeyMaker posted:Anyone here going to DjangoCon? I'm there right now
|
# ? Sep 6, 2011 18:35 |
|
Xenos posted:I'm there right now Hey, me too! Look for the dude giving out djangopeople.me stickers (I know, how descriptive!)
|
# ? Sep 7, 2011 01:31 |
|
Does anyone know what a django thing called "Zamboni" is? For the loving life of me I cant work it out, but for some reason my curiosity is killing me. e: Oh never mind its some mozilla internal stuff that uses django which has created a bit of google polution for runserver_plus in a few queries duck monster fucked around with this message at 08:34 on Sep 7, 2011 |
# ? Sep 7, 2011 08:31 |
|
Xenos posted:I'm there right now MonkeyMaker posted:Hey, me too! Look for the dude giving out djangopeople.me stickers (I know, how descriptive! My jealousy knows no bounds... next year !
|
# ? Sep 7, 2011 12:36 |
|
MonkeyMaker posted:Hey, me too! Look for the dude giving out djangopeople.me stickers (I know, how descriptive!) I'm here too
|
# ? Sep 7, 2011 17:54 |
|
If anyone wants a DjangoCon 2011 t-shirt, they're on sale for $20. I'm willing to pick them up for you, just Paypal me cost + shipping. hit me on twitter at @kennethlove for fastest responses.
|
# ? Sep 8, 2011 17:27 |
|
MonkeyMaker posted:If anyone wants a DjangoCon 2011 t-shirt, they're on sale for $20. I'm willing to pick them up for you, just Paypal me cost + shipping. hit me on twitter at @kennethlove for fastest responses. Say, didn't Steve Ivy say yesterday that you wanted to meet up with me? EDIT: No, wait, that was some other guy. I think you still said you wanted to say hi though I'm in the middle rear of the lightning talks room at the moment...
|
# ? Sep 8, 2011 18:18 |
|
MonkeyMaker posted:If anyone wants a DjangoCon 2011 t-shirt, they're on sale for $20. I'm willing to pick them up for you, just Paypal me cost + shipping. hit me on twitter at @kennethlove for fastest responses. You gave that CBV talk?
|
# ? Sep 8, 2011 20:15 |
|
Profane Obituary! posted:You gave that CBV talk? Yeah. And the one about Banana-py.
|
# ? Sep 8, 2011 21:39 |
|
MonkeyMaker posted:Yeah. And the one about Banana-py. Well assuming no one does it during a sprint, your talk started the ball rolling on me fixing the docs for CBV's. I use the poo poo out of them and they are awesome (Also FormView is not hard!)
|
# ? Sep 9, 2011 02:57 |
|
I was never able to get the live streams working from the office. Any idea on how soon until the sessions are posted on Blip? It seems like it has taken a few weeks in the past.
|
# ? Sep 13, 2011 20:06 |
|
And they are up: http://blip.tv/djangocon
|
# ? Sep 21, 2011 12:57 |
|
I'm trying to figure out how to automatically load data into my app, sort of like a fixture but with a lot helper-functions to simplify the construction of the data set by hand. I decided on a YAML format, but now I'm having difficulty resolving the data into an actual instance of a model. Say I have a model like this: code:
code:
code:
Does anyone have an idea of how to do this?
|
# ? Sep 26, 2011 20:43 |
|
I've been tasked with making some improvements to an internal web tool, as a way of getting up to speed on Python and Django. I have a FilteredSelectMultiple widget in place, and it's pulling in data properly, however I haven't been able to nail saving yet. Through a bunch of googling, I've figured out that I need to handle saving the intermediary model's data. Here are the requisite models: code:
code:
|
# ? Sep 26, 2011 23:39 |
|
Why does ServerAdminForm have a "servers" field? There's no such field on the model. The only model there with a "servers" field is Profile. Should you be looking at ProfileAdmin instead? Anyway, do you know about this? https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.filter_horizontal code:
|
# ? Sep 27, 2011 10:35 |
|
Puddy Dumplins posted:I know how to get class_def, but I'm not exactly sure how to loop over the fields of that class, much less knowing how to check what type of class they are. How about something like this: code:
|
# ? Sep 27, 2011 10:55 |
|
raymond posted:Why does ServerAdminForm have a "servers" field? There's no such field on the model. The only model there with a "servers" field is Profile. Should you be looking at ProfileAdmin instead? You're right about the form, I should have named it ProfileAdminForm. However, I don't think that changes anything functionally. I took a look at filter_horizontal, and it sounds exactly like a FilteredSelectMultiple widget, so I'm already using that. My issue is essentially that I am using a "through" table, ServerGroup, to store the servers tracked in a profile. Because of that, from what I've read, a typical save_m2m() doesn't work, as it doesn't handle saving the through table's data. I just don't know how to get the servers selected from the widget, then save them along with the profile into the ServerGroup table. Edit: to be more specific, when I try to save the form, the error I get is: Cannot set values on a ManyToManyField which specifies an intermediary model. Use monitor.ServerGroup's Manager instead. What I'm having trouble with is using the manager to save that data - I don't know how to get the selected servers from the form. xpander fucked around with this message at 21:37 on Sep 27, 2011 |
# ? Sep 27, 2011 17:52 |
|
raymond posted:How about something like this: Cool! I didn't know about ._meta... thanks buddy!
|
# ? Sep 27, 2011 18:47 |
|
^^^ You're welcome.xpander posted:You're right about the form, I should have named it ProfileAdminForm. However, I don't think that changes anything functionally. Do you need to use the "through" table? They are pretty troublesome in the admin. This works for me: code:
code:
|
# ? Sep 27, 2011 23:41 |
|
raymond posted:You've also got "model = Server" in the form, which changes (perhaps breaks) things. ProfileAdmin should use ProfileForm (IF you must define a custom form) which should use the Profile model. Yeah I'd changed that too, though with no luck. raymond posted:Do you need to use the "through" table? They are pretty troublesome in the admin. I just picked up this project, to modify what is currently in use. I can pretty much change whatever I want, it's just a matter of what's simplest for me to do. I made your suggested changes, though I had to specify the table - syncdb wasn't creating the new table, and the app was complaining that what it wanted was missing. However, reusing the old table works! Thanks a bunch.
|
# ? Sep 28, 2011 00:09 |
|
Looking at the next thing to do, I realized I need to add another field to the above. Each server selected will also have a related database table that needs to be stored. Altering the servergroup table itself is no problem, but I'm not sure how to best represent that in the form. Off the top of my head, having a label for each entry in the servergroup table with a textbox beside it to input the table name would work. Does anyone have a more elegant suggestion?
|
# ? Sep 28, 2011 00:58 |
|
The new Heroku for Django is Heroku: http://devcenter.heroku.com/articles/django
|
# ? Sep 29, 2011 00:15 |
|
IsotopeOrange posted:The new Heroku for Django is Heroku: http://devcenter.heroku.com/articles/django Why would you link that and not the actually pretty great blog post introducing it? As a Pythonista I think this is one of the best descriptions of the language, community and ecosystem ever.
|
# ? Sep 29, 2011 01:27 |
|
bitprophet posted:As a Pythonista I think this is one of the best descriptions of the language, community and ecosystem ever. I'm at heroku, so if anyone here has platform questions, I'm happy to help. I have to admit though that my python-specific skills aren't that great. I'm really excited that it's official now. We've had python as a (not very secret) beta for a while and that's been going great.
|
# ? Sep 29, 2011 04:48 |
|
IsotopeOrange posted:The new Heroku for Django is Heroku: http://devcenter.heroku.com/articles/django And a Django Core Dev Response: http://news.ycombinator.com/item?id=3050760
|
# ? Sep 29, 2011 14:12 |
|
Any Django devs in the UK recommend any hosting? I've been using Kutoken but I'm not all that impressed.
|
# ? Sep 29, 2011 15:38 |
|
Hanpan posted:Any Django devs in the UK recommend any hosting? I've been using Kutoken but I'm not all that impressed. Isn't WebFaction in the UK? It's pretty good for Django traditional shared hosting.
|
# ? Sep 29, 2011 17:06 |
|
Hanpan posted:Any Django devs in the UK recommend any hosting? I've been using Kutoken but I'm not all that impressed. Hopefully you're already aware of it, but ep.io (a PaaS) is UK-based. EDIT: Oh right, they're still invite-only. Still
|
# ? Sep 29, 2011 18:28 |
|
A A 2 3 5 8 K posted:Isn't WebFaction in the UK? It's pretty good for Django traditional shared hosting. Based in, but not hosted in. Their servers are at The Planet in Texas, or something. 100msec ping in an SSH session can be a proper chore. Also once you get over a certain number of sites/applications, their panel feels like wading through molasses. They're very good at support, and the hosting itself is pretty good.
|
# ? Sep 29, 2011 18:51 |
|
I found a bug in my filter_horizontal usage: it won't delete the last item selected. I can move items from left to right without issue, and can delete all but the last selected item and save successfully. However, when I go to remove that last item, I get "Please correct the error below", with the required field being the entire widget, from what I can tell. Is it forcing a 1-item minimum somewhere that I don't know about? Edit - nevermind, had to add "blank=True" to the appropriate field in that model, problem solved! xpander fucked around with this message at 23:37 on Sep 29, 2011 |
# ? Sep 29, 2011 19:59 |
|
Heyo, sanity check! So I'm using Django to ease database interactions with python (bypassing the "website" aspect entirely in a few areas). I'm using it to do some game programming, serverside stuff. I'm writing a turn based combat system that keeps track of a healthy amount of data that will be changing a lot. This means that I'm going to be storing snapshots of all the relevant data (equipped items, base stats, player details) in each instance of the fight, in a database object. One of the things I realized that would be really helpful for me to do, but that I'm here to sanity check, is for some data I could just pickle a python object and throw it into a blob field. Like for example I want to keep track of modifiers applied to people (poison, armor buffs etc), and naturally I want to use a list or something. I could just pickle that list and throw it into a blob field that's called "Modifiers", then unpickle it and have that easy object and it's children later. Crazy?
|
# ? Sep 29, 2011 20:46 |
|
Serializing objects into your database is a quick and dirty hack that is only useful when you don't need to query any of that information from the database. You inevitably will want to as your game grows more complicated and then you'll punch yourself in the dick for being so short sighted. This isn't specific to python or Django though. Usually the only data that you want to store as a blob is stuff that's already compressed like images or zip files. Everything else should really be a part of your data model.
|
# ? Sep 29, 2011 21:04 |
|
Crazy, and not crazy. Personally, I'd avoid the pickling into a column, in favour of additional models, for the simplistic reason that pickling the list means it's valid at that point in time. You can't easily adapt the data structure or change values in it without writing interim methods to translate it. This may not be a big issue because you're describing snapshots of player data, I suppose, but it'd make it hard to add in new modifiers, or tweak values, I think. Django has got pluggable cache backends anyway, many of which, I suspect, pickle whatever is passed in.
|
# ? Sep 29, 2011 21:05 |
|
Note: Don't use Pickle for any data that might even remotely come from a User. Unless you like giving your users the ability to execute arbitrary python that is.
|
# ? Sep 29, 2011 22:59 |
|
HMMMMMMM Thanks guys, good input, I'll do everything I can to avoid pickling. What I'm looking at is taking a snapshot of all the relevant skills/items/commonly changed information in this persistent multiplayer world for reference with that particular combat instance. This is because over time the skill/item definitions will change and I want people to be able to take a historical look at their old fights, (and also incase a staffer updates the item definition mid-fight) so I figure if I pickle a snapshot of some basic values it'll be a pretty sure fire way of achieving that goal instead of making tons of database objects of redundant data for every single fight. Another way around this could be to keep track of changes automatically, just keep a hash of the definition values as a primary key or something so if some day a fight is initiated where values have changed, the hashes wont line up and it will just make a new one. Lots of thinking to do, so many ways to do this, and unless I write like 30 paragraphs on this whole system I'm not sure I can give enough information for all you smarties to give perfect input, I'll work with what I get. If anyone's interested though I'll definitely do a huge brain dump and see what I get back. I don't have a lot of experience doing database planning for games.
|
# ? Sep 29, 2011 23:17 |
|
Definitely don't pickle it then! The object that represents your items or whatever will change in the future as you add more features and your old pickled items in the database won't work anymore! I made a browswer based game for D&D using Django once, but I never finished it because .
|
# ? Sep 29, 2011 23:33 |
|
MEAT TREAT posted:Definitely don't pickle it then! The object that represents your items or whatever will change in the future as you add more features and your old pickled items in the database won't work anymore! The item definitions will change but they are simple key:value pairs. The functionality of the storage class doesn't change really. Lemme give some examples of item definitions and how much they can vary and maybe someone can explain to me a good way to store this information in a database. code:
Perhaps I should do this:
That way I can refer to specific points in time of an action's definition if necessary (retrospective) but pull up the latest version of an action definition for new fights. I can write some setter/getter functions for the model that stores all this so when you say ActionModelInstance["target_range"] it just finds target_range in the definition and returns the value to the right of = Runtime performance isn't a biggy because none of this is per-frame, nor does it need to scale very high.
|
# ? Sep 29, 2011 23:55 |
|
|
# ? May 16, 2024 21:18 |
|
Mido, you may be interested in this JSONField. I first saw it as part of djangobb, but I think it's actually more common than that. I think its exactly what you are asking for.code:
code:
|
# ? Sep 30, 2011 00:12 |