For instance, I have a system that will import a spreadsheet of product categories, I've written a test to ensure that when an admin goes to this view they are presented with a template
tolja
It should cover most stuff you'd want to test
pete___
But for things like "make sure we have a spreadsheet" where do I draw the line? What separates a test from just functionality?
tolja, yea I found that a few months ago but didn't really get too far through it. Guess I will read it again
AlwaysHigh
hey trying to setup a new model where for example i have multiple takeaway shops in multiple cities should i create a model instance of that shop for each city ?
or a single shop with many cities
aossama has quit
jarshwah has quit
aossama joined the channel
Wooble
AlwaysHigh: I'd expect the model to include an address and phone number in which case the latter wouldn't work at all...
AlwaysHigh
Wooble, its only an example its merely gonna have the name and relative locations
shangxiao joined the channel
there no decernible difference from each location other than its location in my need
but ive never setup a model where it has multiple relationships froma single model
only used manytoone not onetomany
shangxiao has quit
usr123 has quit
but i see that django doesnt seem to have a onetomany
Any ideas on a solution. I can either A. make the pk smaller number or B. make view return String so JSON.parse will work.
shangxiao has quit
hylje
ah 53 bits
fission6 joined the channel
Wooble
hylje: JS doesn't actually have integers at all :)
vmonteco
If I have pluralized messages (msgid + msgid_plural in .po), can a simple gettext() use the msgid alone or do I have to use ngettext? gettext doesn't seem to work
hylje
Wooble: yes they're all floats, but floats can represent exact integers up to a limit
daydreamm joined the channel
which leads to that hilarious nodejs bug with filesystem inodes
riclima_ joined the channel
aossama has quit
elgin
Any ideas on a solution. I can either A. make the pk smaller number or B. make view return String so JSON.parse will work./
Are they not all objects technically?
hylje
string is a fine workaround, it's not like you're going to do arithmetic on an PK
elgin
True, will use a string in that case.
greg_f has quit
Will I suppose all either primitive or reference. Float is number, which is primitive.
roadie has quit
GraysonBriggs joined the channel
adsworth has quit
elgin has left the channel
luxeve joined the channel
kuter has quit
briian joined the channel
fission6 has quit
rustx joined the channel
briian
yo
EyePulp joined the channel
rustx
yo
luxeve_ joined the channel
hylje
ayy
briian
i wish django could design front end for me
css and all
that would be nice
rustx
bootstrap4 is already a good help isn't it ?
hylje
yes it would be nice
rustx
just get a template .. and you should be fine
briian
im doing datatables stuff and editing the style is such a pita
has anyone setup a drf that allows read to authenticated only but only allows superusers to create/update?
hylje
make a default permission that requires auth always and superuser to modify
Xorg has quit
AlwaysHigh
u mean custom?
riclima_ has quit
Dulcin joined the channel
Dunedan has quit
hylje
ye and then make it the default one in rest framework settings
luxeve has quit
AlwaysHigh
might take me a while to nut that out :P
looking at docs
vince164 joined the channel
hylje
permissions are pretty straightforward
Dulcin
Django-haystack related question, I'm getting an: haystack.exceptions.SearchFieldError: The model <model> does not have a model_attr 'intro' -- this happens on a model for which I have removed that field. I ran an build_solr_schema, copied the schema, restarted solr, rebuild_index, but the same error appears and that field keeps appearing in my managed_schema as well, even though it's completely removed from my code except for my migrations.
AlwaysHigh
hylje, i remember what got me was how do u define each method Create/Get
hylje
get/head are read only ops, everything else is write
AlwaysHigh
when returning from .has_permissions
i feel like im using the wrong viewset
elit3x has quit
rajesh has quit
briian
damn man
i do all my updates in vim
elit3x joined the channel
and i wanted to switch to local to do front end stuff, but i just realized i cant install django or anything because i cant install pip
feelsbadman
back to vim
moldy
why can't you install pip?
briian
no root lol
AlwaysHigh
briian, u can install a local instance
moldy
ugh, no root on your own development box?
briian
nop
cant edit anything
moldy
meh, tell $person to give you root
briian
some people have virtual instances
but idk how they got them
moldy
alternatively, you can install python & pip as non-root
u can do this kinda thing when installing from sourc
moldy
you may have to ask the person who has root to install some os packages though
briian
yeah looking at something like that now AlwaysHigh
didnt htink about that ill try it
_val_
Guys, I have e.g: list_filter = ('status','os_type','cpu_sockets','memory') but getting an error saying: <class 'spiderman.vmlist.admin.VMAdmin'>: (admin.E116) The value of 'list_filter[3]' refers to 'memory', which does not refer to a Field.
briian
lol no wget
rip
AlwaysHigh
curl?
_val_
however, there is a function called memory
briian
sec lemme check your link
moldy
AlwaysHigh, briian: that might work, but it usually requires to install a few os packages like libssl-dev and such
briian
mm if i could just get it to run it would be perfect
mattmcc
_val_: The ORM can't filter querysets on a Python function.
briian
since i only need views to work
AlwaysHigh
what os are u using briian
_val_
mattmcc: how to resolve it?
briian
osx
_val_
I wrote a function to round memory to GB's instead.
AlwaysHigh
briian, never really used osx for this stuff cant really say it will work lol